aboutsummaryrefslogtreecommitdiff
path: root/src/docker-in-docker/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/docker-in-docker/install.sh')
-rwxr-xr-xsrc/docker-in-docker/install.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/docker-in-docker/install.sh b/src/docker-in-docker/install.sh
index a67aaba..afcdc1a 100755
--- a/src/docker-in-docker/install.sh
+++ b/src/docker-in-docker/install.sh
@@ -11,6 +11,7 @@
DOCKER_VERSION=${VERSION:-"latest"} # The Docker/Moby Engine + CLI should match in version
USE_MOBY=${MOBY:-"true"}
DOCKER_DASH_COMPOSE_VERSION=${DOCKERDASHCOMPOSEVERSION:-"v1"} # v1 or v2
+AZURE_DNS_AUTO_DETECTION=${AZUREDNSAUTODETECTION:-"true"}
ENABLE_NONROOT_DOCKER=${ENABLE_NONROOT_DOCKER:-"true"}
USERNAME=${USERNAME:-"automatic"}
@@ -312,7 +313,7 @@ if [ "${ENABLE_NONROOT_DOCKER}" = "true" ]; then
fi
tee /usr/local/share/docker-init.sh > /dev/null \
-<< 'EOF'
+<< EOF
#!/bin/sh
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -321,6 +322,11 @@ tee /usr/local/share/docker-init.sh > /dev/null \
set -e
+AZURE_DNS_AUTO_DETECTION=$AZURE_DNS_AUTO_DETECTION
+EOF
+
+tee -a /usr/local/share/docker-init.sh > /dev/null \
+<< 'EOF'
dockerd_start="$(cat << 'INNEREOF'
# explicitly remove dockerd and containerd PID file to ensure that it can start properly if it was stopped uncleanly
# ie: docker kill <ID>
@@ -360,7 +366,7 @@ dockerd_start="$(cat << 'INNEREOF'
# Handle DNS
set +e
cat /etc/resolv.conf | grep -i 'internal.cloudapp.net'
- if [ $? -eq 0 ]
+ if [ $? -eq 0 ] && [ ${AZURE_DNS_AUTO_DETECTION} = "true" ]
then
echo "Setting dockerd Azure DNS."
CUSTOMDNS="--dns 168.63.129.16"