Skip to content

Commit b624e84

Browse files
committed
Make DOCKER_HOST more robust
1 parent cf1fe81 commit b624e84

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

repo2docker/app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,12 @@ def start_container(self):
588588
client = self.get_engine()
589589

590590
docker_host = os.environ.get("DOCKER_HOST")
591-
if docker_host and docker_host.find("podman") != -1:
592-
host_name = urlparse(docker_host).hostname
591+
if docker_host:
592+
docker_host_parsed = urlparse(docker_host)
593+
if docker_host_parsed.scheme == "unix":
594+
host_name = "127.0.0.1"
595+
else:
596+
host_name = docker_host_parsed.hostname
593597
else:
594598
host_name = "127.0.0.1"
595599
self.hostname = host_name

0 commit comments

Comments
 (0)