File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -107,15 +107,21 @@ def docker_runner(params):
107
107
"""Starts a Docker container before tests and gracefully terminates it after."""
108
108
109
109
def is_docker_running ():
110
- """Check if Docker has been run ."""
110
+ """Check if Docker is running and optionally skip pulling the image ."""
111
111
try :
112
112
subprocess .run (
113
113
["docker" , "info" ],
114
114
stdout = subprocess .DEVNULL ,
115
115
stderr = subprocess .DEVNULL ,
116
116
check = True ,
117
117
)
118
- subprocess .run (["docker" , "pull" , LOCALNET_IMAGE_NAME ], check = True )
118
+
119
+ skip_pull = os .getenv ("SKIP_PULL" , "0" ) == "1"
120
+ if not skip_pull :
121
+ subprocess .run (["docker" , "pull" , LOCALNET_IMAGE_NAME ], check = True )
122
+ else :
123
+ print (f"[SKIP_PULL=1] Skipping 'docker pull { LOCALNET_IMAGE_NAME } '" )
124
+
119
125
return True
120
126
except subprocess .CalledProcessError :
121
127
return False
You can’t perform that action at this time.
0 commit comments