@@ -181,7 +181,9 @@ def runTest(self):
181
181
container = self .client .create_container (
182
182
'busybox' ,
183
183
['ls' , mount_dest ], volumes = {mount_dest : {}},
184
- host_config = create_host_config (binds = binds )
184
+ host_config = create_host_config (
185
+ binds = binds , network_mode = 'none'
186
+ )
185
187
)
186
188
container_id = container ['Id' ]
187
189
self .client .start (container_id )
@@ -221,7 +223,9 @@ def runTest(self):
221
223
container = self .client .create_container (
222
224
'busybox' ,
223
225
['ls' , mount_dest ], volumes = {mount_dest : {}},
224
- host_config = create_host_config (binds = binds )
226
+ host_config = create_host_config (
227
+ binds = binds , network_mode = 'none'
228
+ )
225
229
)
226
230
container_id = container ['Id' ]
227
231
self .client .start (container_id )
@@ -273,7 +277,9 @@ class TestCreateContainerReadOnlyFs(BaseTestCase):
273
277
def runTest (self ):
274
278
ctnr = self .client .create_container (
275
279
'busybox' , ['mkdir' , '/shrine' ],
276
- host_config = create_host_config (read_only = True )
280
+ host_config = create_host_config (
281
+ read_only = True , network_mode = 'none'
282
+ )
277
283
)
278
284
self .assertIn ('Id' , ctnr )
279
285
self .tmp_containers .append (ctnr ['Id' ])
@@ -347,7 +353,9 @@ def runTest(self):
347
353
class TestCreateContainerPrivileged (BaseTestCase ):
348
354
def runTest (self ):
349
355
res = self .client .create_container (
350
- 'busybox' , 'true' , host_config = create_host_config (privileged = True )
356
+ 'busybox' , 'true' , host_config = create_host_config (
357
+ privileged = True , network_mode = 'none'
358
+ )
351
359
)
352
360
self .assertIn ('Id' , res )
353
361
self .tmp_containers .append (res ['Id' ])
@@ -591,7 +599,9 @@ def runTest(self):
591
599
592
600
container = self .client .create_container (
593
601
'busybox' , ['sleep' , '60' ], ports = list (port_bindings .keys ()),
594
- host_config = create_host_config (port_bindings = port_bindings )
602
+ host_config = create_host_config (
603
+ port_bindings = port_bindings , network_mode = 'bridge'
604
+ )
595
605
)
596
606
id = container ['Id' ]
597
607
@@ -717,7 +727,9 @@ def runTest(self):
717
727
)
718
728
res2 = self .client .create_container (
719
729
'busybox' , 'cat' , detach = True , stdin_open = True ,
720
- host_config = create_host_config (volumes_from = vol_names )
730
+ host_config = create_host_config (
731
+ volumes_from = vol_names , network_mode = 'none'
732
+ )
721
733
)
722
734
container3_id = res2 ['Id' ]
723
735
self .tmp_containers .append (container3_id )
@@ -760,7 +772,8 @@ def runTest(self):
760
772
761
773
res2 = self .client .create_container (
762
774
'busybox' , 'env' , host_config = create_host_config (
763
- links = {link_path1 : link_alias1 , link_path2 : link_alias2 }
775
+ links = {link_path1 : link_alias1 , link_path2 : link_alias2 },
776
+ network_mode = 'none'
764
777
)
765
778
)
766
779
container3_id = res2 ['Id' ]
@@ -781,7 +794,8 @@ class TestRestartingContainer(BaseTestCase):
781
794
def runTest (self ):
782
795
container = self .client .create_container (
783
796
'busybox' , ['sleep' , '2' ], host_config = create_host_config (
784
- restart_policy = {"Name" : "always" , "MaximumRetryCount" : 0 }
797
+ restart_policy = {"Name" : "always" , "MaximumRetryCount" : 0 },
798
+ network_mode = 'none'
785
799
)
786
800
)
787
801
id = container ['Id' ]
@@ -910,7 +924,7 @@ class TestCreateContainerWithHostPidMode(BaseTestCase):
910
924
def runTest (self ):
911
925
ctnr = self .client .create_container (
912
926
'busybox' , 'true' , host_config = create_host_config (
913
- pid_mode = 'host'
927
+ pid_mode = 'host' , network_mode = 'none'
914
928
)
915
929
)
916
930
self .assertIn ('Id' , ctnr )
@@ -945,7 +959,7 @@ def runTest(self):
945
959
946
960
container2 = self .client .create_container (
947
961
'busybox' , 'cat' , host_config = create_host_config (
948
- links = {link_path : link_alias }
962
+ links = {link_path : link_alias }, network_mode = 'none'
949
963
)
950
964
)
951
965
container2_id = container2 ['Id' ]
0 commit comments