File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 2020from .engine import Container , ContainerEngine , Image
2121from .utils import execute_cmd
2222
23+ DOCKER_HOST = os .getenv ("DOCKER_HOST" )
24+ if DOCKER_HOST is not None and DOCKER_HOST .find ("podman" ) != - 1 :
25+ DOCKER_CLI = "podman"
26+ else :
27+ DOCKER_CLI = "docker"
28+
2329
2430class DockerContainer (Container ):
2531 def __init__ (self , container ):
@@ -73,11 +79,7 @@ def container_cli(self):
7379 if self ._container_cli is not None :
7480 return self ._container_cli
7581
76- docker_host = os .getenv ("DOCKER_HOST" )
77- if docker_host is not None and docker_host .find ("podman" ) != - 1 :
78- cli = "podman"
79- else :
80- cli = "docker"
82+ cli = DOCKER_CLI
8183
8284 docker_version = subprocess .run ([cli , "version" ], stdout = subprocess .DEVNULL )
8385 if docker_version .returncode :
You can’t perform that action at this time.
0 commit comments