diff options
author | Kevin Klopfenstein <kklopfenstein@users.noreply.github.com> | 2022-10-06 20:54:20 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-06 20:54:20 +0300 |
commit | a9441adf0e023605d6afbbacfd9521634e02a59a (patch) | |
tree | c94864923f4c3ad15cb83a74c525ecb81e4fb30b /src/docker-in-docker/install.sh | |
parent | 82960fd16b04fb4003a8765b2381bd23553737b5 (diff) |
Add docker-in-docker azure_dns_override flag (#200)
* Add docker-in-docker azure_dns_overrideflag
* Update install.sh
* clarify variable name
* update option name and description for `azureDnsAutoDetection`
* bump feature version
Co-authored-by: Josh Spicer <josh@joshspicer.com>
Diffstat (limited to 'src/docker-in-docker/install.sh')
-rwxr-xr-x | src/docker-in-docker/install.sh | 10 |
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" |