Skip to content

Commit 4fca96b

Browse files
[Docker-in-docker] Updates docker-init scripts (#715)
* updates * version bump
1 parent 0d7ad7c commit 4fca96b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/docker-in-docker/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "docker-in-docker",
3-
"version": "2.6.0",
3+
"version": "2.7.0",
44
"name": "Docker (Docker-in-Docker)",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-in-docker",
66
"description": "Create child containers *inside* a container, independent from the host's docker instance. Installs Docker extension in the container along with needed CLIs.",

src/docker-in-docker/install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,6 @@ EOF
362362
tee -a /usr/local/share/docker-init.sh > /dev/null \
363363
<< 'EOF'
364364
dockerd_start="AZURE_DNS_AUTO_DETECTION=${AZURE_DNS_AUTO_DETECTION} DOCKER_DEFAULT_ADDRESS_POOL=${DOCKER_DEFAULT_ADDRESS_POOL} $(cat << 'INNEREOF'
365-
# Stop dockerd and containerd in case they are already running
366-
docker info > /dev/null 2>&1 && pkill dockerd && pkill containerd
367365
# explicitly remove dockerd and containerd PID file to ensure that it can start properly if it was stopped uncleanly
368366
find /run /var/run -iname 'docker*.pid' -delete || :
369367
find /run /var/run -iname 'container*.pid' -delete || :
@@ -478,10 +476,12 @@ do
478476
retry_count=`expr $retry_count + 1`
479477
done
480478
481-
if [ "${docker_ok}" != "true" ]; then
479+
if [ "${docker_ok}" != "true" ] && [ "${retry_docker_start_count}" != "4" ]; then
482480
echo "(*) Failed to start docker, retrying..."
483-
sudo_if pkill dockerd
484-
sudo_if pkill containerd
481+
set +e
482+
sudo_if pkill dockerd
483+
sudo_if pkill containerd
484+
set -e
485485
fi
486486
487487
retry_docker_start_count=`expr $retry_docker_start_count + 1`

0 commit comments

Comments
 (0)