use per user docker socket if system docker socket doesn't exist (#361)

* use per user docker socket if system docker socket doesn't exist

* add retry
This commit is contained in:
Adil Hafeez 2025-01-08 14:55:42 -08:00 committed by GitHub
parent aa11113cea
commit dae6239b81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 4 deletions

View file

@ -4,7 +4,8 @@ import time
import sys
import glob
import docker
from cli.utils import getLogger
from docker.errors import DockerException
from cli.utils import getLogger, update_docker_host_env
from cli.consts import (
ARCHGW_DOCKER_IMAGE,
ARCHGW_DOCKER_NAME,
@ -110,7 +111,12 @@ def start_arch(arch_config_file, env, log_timeout=120, foreground=False):
log.info("Starting arch gateway")
try:
client = docker.from_env()
try:
client = docker.from_env()
except DockerException as e:
# try setting up the docker host environment variable and retry
update_docker_host_env()
client = docker.from_env()
try:
container = client.containers.get("archgw")