From a4b31f314fa1385950a9dbc81682d9acb2e2fba9 Mon Sep 17 00:00:00 2001 From: Samruddhi Khandale Date: Fri, 18 Aug 2023 16:01:50 -0700 Subject: [docker-in-docker] Reverts the retry logic (#659) * Update install.sh * [docker-in-docker] Update retry logic * revert the retry logic! --- src/docker-in-docker/devcontainer-feature.json | 2 +- src/docker-in-docker/install.sh | 30 ++++++-------------------- 2 files changed, 7 insertions(+), 25 deletions(-) (limited to 'src/docker-in-docker') diff --git a/src/docker-in-docker/devcontainer-feature.json b/src/docker-in-docker/devcontainer-feature.json index b5e0aee..2afdd11 100644 --- a/src/docker-in-docker/devcontainer-feature.json +++ b/src/docker-in-docker/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "docker-in-docker", - "version": "2.3.0", + "version": "2.3.1", "name": "Docker (Docker-in-Docker)", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-in-docker", "description": "Create child containers *inside* a container, independent from the host's docker instance. Installs Docker extension in the container along with needed CLIs.", diff --git a/src/docker-in-docker/install.sh b/src/docker-in-docker/install.sh index f7e5a7d..bdef126 100755 --- a/src/docker-in-docker/install.sh +++ b/src/docker-in-docker/install.sh @@ -423,30 +423,12 @@ dockerd_start="AZURE_DNS_AUTO_DETECTION=${AZURE_DNS_AUTO_DETECTION} DOCKER_DEFAU INNEREOF )" -retry_count=0 -docker_ok="false" - -until [ "${docker_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; -do - # Start using sudo if not invoked as root - if [ "$(id -u)" -ne 0 ]; then - sudo /bin/sh -c "${dockerd_start}" - else - eval "${dockerd_start}" - fi - - set +e - docker info > /dev/null 2>&1 && docker_ok="true" - - if [ "${docker_ok}" != "true" ]; then - echo "(*) Failed to start docker, retrying in 5s..." - retry_count=`expr $retry_count + 1` - sleep 5s - fi - set -e -done - -set +e +# Start using sudo if not invoked as root +if [ "$(id -u)" -ne 0 ]; then + sudo /bin/sh -c "${dockerd_start}" +else + eval "${dockerd_start}" +fi # Execute whatever commands were passed in (if any). This allows us # to set this script to ENTRYPOINT while still executing the default CMD. -- cgit v1.2.3