@@ -69,13 +69,13 @@ def parse_args(args=None):
69
69
parser .add_argument ('--network' ,
70
70
help = 'The name of a user-defined network to add the build container '
71
71
'to while building the image' )
72
+ parser .add_argument ('--privileged' , action = 'store_true' ,
73
+ help = 'Run the build container as privileged (for systemd, etc.)' )
72
74
parser .add_argument ('--pull' , action = 'store_true' ,
73
75
help = 'Always pull down the latest base image' )
74
76
parser .add_argument ('-t' , dest = 'tag' , action = 'append' ,
75
77
help = 'A name and optional tag (in the name:tag) format. This option '
76
78
'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.)' )
79
79
80
80
# TODO pass-thru to ansible
81
81
# -M --module-path
@@ -156,6 +156,8 @@ def make_container(config, docker_client):
156
156
Creates and starts the container that ansible will run against.
157
157
"""
158
158
# Generate optional networking config
159
+ host_config = docker_client .create_host_config (
160
+ privileged = config ['privileged' ])
159
161
networking_config = None
160
162
if config ['build_network' ] is not None :
161
163
try :
@@ -170,8 +172,8 @@ def make_container(config, docker_client):
170
172
container = docker_client .create_container (
171
173
config ['docker' ]['base_image' ],
172
174
command = 'sleep 360000' ,
173
- networking_config = networking_config ,
174
- privileged = config [ 'privileged' ] )
175
+ host_config = host_config ,
176
+ networking_config = networking_config )
175
177
176
178
if container ['Warnings' ] is not None :
177
179
# I have never seen this set but display it anyway
0 commit comments