Skip to content

Commit 0309c88

Browse files
committed
Expose DOCKER_CLI from docker.py
1 parent 172ab66 commit 0309c88

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

repo2docker/docker.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
from .engine import Container, ContainerEngine, Image
2121
from .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

2430
class 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:

0 commit comments

Comments
 (0)