aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2023-08-19 02:01:50 +0300
committerGitHub <noreply@github.com>2023-08-19 02:01:50 +0300
commita4b31f314fa1385950a9dbc81682d9acb2e2fba9 (patch)
tree75bf2f793d346389c1c4031e81ad756b7a870b4b /src
parent9fd5daf06b40794a067c4cdbb8e258d99eeefc24 (diff)
[docker-in-docker] Reverts the retry logic (#659)feature_docker-in-docker_2.3.1
* Update install.sh * [docker-in-docker] Update retry logic * revert the retry logic!
Diffstat (limited to 'src')
-rw-r--r--src/docker-in-docker/devcontainer-feature.json2
-rwxr-xr-xsrc/docker-in-docker/install.sh30
2 files changed, 7 insertions, 25 deletions
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.