[Docker-in-docker] Updates docker-init scripts (#715)
* updates * version bump
This commit is contained in:
parent
0d7ad7c5fc
commit
4fca96b5e8
2 changed files with 6 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"id": "docker-in-docker",
|
"id": "docker-in-docker",
|
||||||
"version": "2.6.0",
|
"version": "2.7.0",
|
||||||
"name": "Docker (Docker-in-Docker)",
|
"name": "Docker (Docker-in-Docker)",
|
||||||
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/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.",
|
"description": "Create child containers *inside* a container, independent from the host's docker instance. Installs Docker extension in the container along with needed CLIs.",
|
||||||
|
|
|
@ -362,8 +362,6 @@ EOF
|
||||||
tee -a /usr/local/share/docker-init.sh > /dev/null \
|
tee -a /usr/local/share/docker-init.sh > /dev/null \
|
||||||
<< 'EOF'
|
<< 'EOF'
|
||||||
dockerd_start="AZURE_DNS_AUTO_DETECTION=${AZURE_DNS_AUTO_DETECTION} DOCKER_DEFAULT_ADDRESS_POOL=${DOCKER_DEFAULT_ADDRESS_POOL} $(cat << 'INNEREOF'
|
dockerd_start="AZURE_DNS_AUTO_DETECTION=${AZURE_DNS_AUTO_DETECTION} DOCKER_DEFAULT_ADDRESS_POOL=${DOCKER_DEFAULT_ADDRESS_POOL} $(cat << 'INNEREOF'
|
||||||
# Stop dockerd and containerd in case they are already running
|
|
||||||
docker info > /dev/null 2>&1 && pkill dockerd && pkill containerd
|
|
||||||
# explicitly remove dockerd and containerd PID file to ensure that it can start properly if it was stopped uncleanly
|
# explicitly remove dockerd and containerd PID file to ensure that it can start properly if it was stopped uncleanly
|
||||||
find /run /var/run -iname 'docker*.pid' -delete || :
|
find /run /var/run -iname 'docker*.pid' -delete || :
|
||||||
find /run /var/run -iname 'container*.pid' -delete || :
|
find /run /var/run -iname 'container*.pid' -delete || :
|
||||||
|
@ -478,10 +476,12 @@ do
|
||||||
retry_count=`expr $retry_count + 1`
|
retry_count=`expr $retry_count + 1`
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "${docker_ok}" != "true" ]; then
|
if [ "${docker_ok}" != "true" ] && [ "${retry_docker_start_count}" != "4" ]; then
|
||||||
echo "(*) Failed to start docker, retrying..."
|
echo "(*) Failed to start docker, retrying..."
|
||||||
|
set +e
|
||||||
sudo_if pkill dockerd
|
sudo_if pkill dockerd
|
||||||
sudo_if pkill containerd
|
sudo_if pkill containerd
|
||||||
|
set -e
|
||||||
fi
|
fi
|
||||||
|
|
||||||
retry_docker_start_count=`expr $retry_docker_start_count + 1`
|
retry_docker_start_count=`expr $retry_docker_start_count + 1`
|
||||||
|
|
Loading…
Reference in a new issue