Skip to content

Commit 5f8fa45

Browse files
author
Alan Brenner
committed
post-testing
1 parent 5ae1bec commit 5f8fa45

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

dockalot/docker.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ def parse_args(args=None):
6969
parser.add_argument('--network',
7070
help='The name of a user-defined network to add the build container '
7171
'to while building the image')
72+
parser.add_argument('--privileged', action='store_true',
73+
help='Run the build container as privileged (for systemd, etc.)')
7274
parser.add_argument('--pull', action='store_true',
7375
help='Always pull down the latest base image')
7476
parser.add_argument('-t', dest='tag', action='append',
7577
help='A name and optional tag (in the name:tag) format. This option '
7678
'can be specified multiple times to apply multiple tags')
77-
parser.add_argument('--privileged', action='store_true',
78-
help='Run the build container as privileged (for systemd, etc.)')
7979

8080
# TODO pass-thru to ansible
8181
# -M --module-path
@@ -156,6 +156,8 @@ def make_container(config, docker_client):
156156
Creates and starts the container that ansible will run against.
157157
"""
158158
# Generate optional networking config
159+
host_config = docker_client.create_host_config(
160+
privileged=config['privileged'])
159161
networking_config = None
160162
if config['build_network'] is not None:
161163
try:
@@ -170,8 +172,8 @@ def make_container(config, docker_client):
170172
container = docker_client.create_container(
171173
config['docker']['base_image'],
172174
command='sleep 360000',
173-
networking_config=networking_config,
174-
privileged=config['privileged'])
175+
host_config=host_config,
176+
networking_config=networking_config)
175177

176178
if container['Warnings'] is not None:
177179
# I have never seen this set but display it anyway

0 commit comments

Comments
 (0)