add retry

This commit is contained in:
Adil Hafeez 2025-01-08 14:47:32 -08:00
parent a48c9d654a
commit be2c0330d2
2 changed files with 15 additions and 5 deletions

View file

@ -4,6 +4,7 @@ import time
import sys
import glob
import docker
from docker.errors import DockerException
from cli.utils import getLogger, update_docker_host_env
from cli.consts import (
ARCHGW_DOCKER_IMAGE,
@ -110,8 +111,12 @@ def start_arch(arch_config_file, env, log_timeout=120, foreground=False):
log.info("Starting arch gateway")
try:
update_docker_host_env()
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")