@@ -43,7 +43,7 @@ apt-get-update-if-needed()
4343{
4444 if [ ! -d " /var/lib/apt/lists" ] || [ " $( ls /var/lib/apt/lists/ | wc -l) " = " 0" ]; then
4545 echo " Running apt-get update..."
46- apt-get update
46+ apt-get update --allow-releaseinfo-change
4747 else
4848 echo " Skipping apt-get update."
4949 fi
@@ -55,7 +55,7 @@ export DEBIAN_FRONTEND=noninteractive
5555# Install apt-transport-https, curl, lsb-release, gpg if missing
5656if ! dpkg -s apt-transport-https curl ca-certificates lsb-release > /dev/null 2>&1 || ! type gpg > /dev/null 2>&1 ; then
5757 apt-get-update-if-needed
58- apt-get -y install --no-install-recommends apt-transport-https curl ca-certificates lsb-release gnupg2
58+ apt-get -y install --no-install-recommends apt-transport-https curl ca-certificates lsb-release gnupg2
5959fi
6060
6161# Install Docker / Moby CLI if not already installed
6767 CODENAME=$( lsb_release -cs)
6868 curl -s https://packages.microsoft.com/keys/microsoft.asc | (OUT=$( apt-key add - 2>&1 ) || echo $OUT )
6969 echo " deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-${DISTRO} -${CODENAME} -prod ${CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
70- apt-get update
70+ apt-get update --allow-releaseinfo-change
7171 apt-get -y install --no-install-recommends moby-cli
7272 else
7373 curl -fsSL https://download.docker.com/linux/$( lsb_release -is | tr ' [:upper:]' ' [:lower:]' ) /gpg | (OUT=$( apt-key add - 2>&1 ) || echo $OUT )
7474 echo " deb [arch=amd64] https://download.docker.com/linux/$( lsb_release -is | tr ' [:upper:]' ' [:lower:]' ) $( lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list
75- apt-get update
75+ apt-get update --allow-releaseinfo-change
7676 apt-get -y install --no-install-recommends docker-ce-cli
7777 fi
7878fi
7979
80- # Install Docker Compose if not already installed
80+ # Install Docker Compose if not already installed
8181if type docker-compose > /dev/null 2>&1 ; then
8282 echo " Docker Compose already installed."
8383else
@@ -105,13 +105,13 @@ if [ "${ENABLE_NONROOT_DOCKER}" = "false" ] || [ "${USERNAME}" = "root" ]; then
105105fi
106106
107107# If enabling non-root access and specified user is found, setup socat and add script
108- chown -h " ${USERNAME} " :root " ${TARGET_SOCKET} "
108+ chown -h " ${USERNAME} " :root " ${TARGET_SOCKET} "
109109if ! dpkg -s socat > /dev/null 2>&1 ; then
110110 apt-get-update-if-needed
111111 apt-get -y install socat
112112fi
113113tee /usr/local/share/docker-init.sh > /dev/null \
114- << EOF
114+ << EOF
115115#!/usr/bin/env bash
116116#-------------------------------------------------------------------------------------------------------------
117117# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -143,8 +143,8 @@ log()
143143echo -e "\n** \$ (date) **" | sudoIf tee -a \$ {SOCAT_LOG} > /dev/null
144144log "Ensuring ${USERNAME} has access to ${SOURCE_SOCKET} via ${TARGET_SOCKET} "
145145
146- # If enabled, try to add a docker group with the right GID. If the group is root,
147- # fall back on using socat to forward the docker socket to another unix socket so
146+ # If enabled, try to add a docker group with the right GID. If the group is root,
147+ # fall back on using socat to forward the docker socket to another unix socket so
148148# that we can set permissions on it without affecting the host.
149149if [ "${ENABLE_NONROOT_DOCKER} " = "true" ] && [ "${SOURCE_SOCKET} " != "${TARGET_SOCKET} " ] && [ "${USERNAME} " != "root" ] && [ "${USERNAME} " != "0" ]; then
150150 SOCKET_GID=\$ (stat -c '%g' ${SOURCE_SOCKET} )
@@ -171,7 +171,7 @@ if [ "${ENABLE_NONROOT_DOCKER}" = "true" ] && [ "${SOURCE_SOCKET}" != "${TARGET_
171171 log "Success"
172172fi
173173
174- # Execute whatever commands were passed in (if any). This allows us
174+ # Execute whatever commands were passed in (if any). This allows us
175175# to set this script to ENTRYPOINT while still executing the default CMD.
176176set +e
177177exec "\$ @"
0 commit comments