@@ -181,7 +181,8 @@ 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' )
185
186
)
186
187
container_id = container ['Id' ]
187
188
self .client .start (container_id )
@@ -221,7 +222,8 @@ def runTest(self):
221
222
container = self .client .create_container (
222
223
'busybox' ,
223
224
['ls' , mount_dest ], volumes = {mount_dest : {}},
224
- host_config = create_host_config (binds = binds )
225
+ host_config = create_host_config (
226
+ binds = binds , network_mode = 'none' )
225
227
)
226
228
container_id = container ['Id' ]
227
229
self .client .start (container_id )
@@ -273,7 +275,8 @@ class TestCreateContainerReadOnlyFs(BaseTestCase):
273
275
def runTest (self ):
274
276
ctnr = self .client .create_container (
275
277
'busybox' , ['mkdir' , '/shrine' ],
276
- host_config = create_host_config (read_only = True )
278
+ host_config = create_host_config (
279
+ read_only = True , network_mode = 'none' )
277
280
)
278
281
self .assertIn ('Id' , ctnr )
279
282
self .tmp_containers .append (ctnr ['Id' ])
@@ -347,7 +350,8 @@ def runTest(self):
347
350
class TestCreateContainerPrivileged (BaseTestCase ):
348
351
def runTest (self ):
349
352
res = self .client .create_container (
350
- 'busybox' , 'true' , host_config = create_host_config (privileged = True )
353
+ 'busybox' , 'true' , host_config = create_host_config (
354
+ privileged = True , network_mode = 'none' )
351
355
)
352
356
self .assertIn ('Id' , res )
353
357
self .tmp_containers .append (res ['Id' ])
@@ -591,7 +595,8 @@ def runTest(self):
591
595
592
596
container = self .client .create_container (
593
597
'busybox' , ['sleep' , '60' ], ports = list (port_bindings .keys ()),
594
- host_config = create_host_config (port_bindings = port_bindings )
598
+ host_config = create_host_config (
599
+ port_bindings = port_bindings , network_mode = 'bridge' )
595
600
)
596
601
id = container ['Id' ]
597
602
@@ -717,7 +722,8 @@ def runTest(self):
717
722
)
718
723
res2 = self .client .create_container (
719
724
'busybox' , 'cat' , detach = True , stdin_open = True ,
720
- host_config = create_host_config (volumes_from = vol_names )
725
+ host_config = create_host_config (
726
+ volumes_from = vol_names , network_mode = 'none' )
721
727
)
722
728
container3_id = res2 ['Id' ]
723
729
self .tmp_containers .append (container3_id )
@@ -760,7 +766,8 @@ def runTest(self):
760
766
761
767
res2 = self .client .create_container (
762
768
'busybox' , 'env' , host_config = create_host_config (
763
- links = {link_path1 : link_alias1 , link_path2 : link_alias2 }
769
+ links = {link_path1 : link_alias1 , link_path2 : link_alias2 },
770
+ network_mode = 'none'
764
771
)
765
772
)
766
773
container3_id = res2 ['Id' ]
@@ -781,7 +788,8 @@ class TestRestartingContainer(BaseTestCase):
781
788
def runTest (self ):
782
789
container = self .client .create_container (
783
790
'busybox' , ['sleep' , '2' ], host_config = create_host_config (
784
- restart_policy = {"Name" : "always" , "MaximumRetryCount" : 0 }
791
+ restart_policy = {"Name" : "always" , "MaximumRetryCount" : 0 },
792
+ network_mode = 'none'
785
793
)
786
794
)
787
795
id = container ['Id' ]
@@ -910,7 +918,7 @@ class TestCreateContainerWithHostPidMode(BaseTestCase):
910
918
def runTest (self ):
911
919
ctnr = self .client .create_container (
912
920
'busybox' , 'true' , host_config = create_host_config (
913
- pid_mode = 'host'
921
+ pid_mode = 'host' , network_mode = 'none'
914
922
)
915
923
)
916
924
self .assertIn ('Id' , ctnr )
@@ -945,7 +953,7 @@ def runTest(self):
945
953
946
954
container2 = self .client .create_container (
947
955
'busybox' , 'cat' , host_config = create_host_config (
948
- links = {link_path : link_alias }
956
+ links = {link_path : link_alias }, network_mode = 'none'
949
957
)
950
958
)
951
959
container2_id = container2 ['Id' ]
0 commit comments