diff --git a/build-docker.sh b/build-docker.sh index 79b68d4..a9a2ce3 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -14,6 +14,11 @@ if ! ${DOCKER} ps >/dev/null; then exit 1 fi +# Pass APT_PROXY into Docker run environment +if test -n "$APT_PROXY"; then + DOCKER_APT_PROXY="-e APT_PROXY=$APT_PROXY" +fi + CONFIG_FILE="" if [ -f "${DIR}/config" ]; then CONFIG_FILE="${DIR}/config" @@ -78,7 +83,7 @@ if [ "${CONTAINER_EXISTS}" != "" ]; then trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${CONTAINER_NAME}_cont' SIGINT SIGTERM time ${DOCKER} run --rm --privileged \ --volume "${CONFIG_FILE}":/config:ro \ - -e "GIT_HASH=${GIT_HASH}" \ + -e "GIT_HASH=${GIT_HASH}" ${DOCKER_APT_PROXY} \ --volumes-from="${CONTAINER_NAME}" --name "${CONTAINER_NAME}_cont" \ pi-gen \ bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static && @@ -89,7 +94,7 @@ else trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${CONTAINER_NAME}' SIGINT SIGTERM time ${DOCKER} run --name "${CONTAINER_NAME}" --privileged \ --volume "${CONFIG_FILE}":/config:ro \ - -e "GIT_HASH=${GIT_HASH}" \ + -e "GIT_HASH=${GIT_HASH}" ${DOCKER_APT_PROXY} \ pi-gen \ bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static && cd /pi-gen; ./build.sh ${BUILD_OPTS} &&