docker-build-proxy: make apt work behind proxy
This patch sends the proxy settings to docker build if present.
Without this, the docker build will fail on apt-get update on a
system that is behind a proxy.
@@ -21,5 +21,15 @@ validate_go_deps_tag "$dockerfile"
"$bindir"/docker-build-go-deps
) >/dev/null
+get_extra_options() {
+ options=
+ for var in http_proxy https_proxy no_proxy; do
+ [ -z "${!var:-}" ] || options="$options --build-arg '$var=${!var}'"
+ done
+ echo $options
+}
+
tag=$(head_root_tag)
-docker_build proxy "$tag" "$dockerfile" --build-arg LINKERD_VERSION="$tag"
+docker_build proxy "$tag" "$dockerfile" \
+ --build-arg "LINKERD_VERSION=$tag" \
+ $(get_extra_options)
\ No newline at end of file
