build-qemu-robot-docker: Support proxy
Make build-qemu-robot-docker.sh support proxy.
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Id15b9c0273f8721c97556b166e4184c5bd7840d3
diff --git a/scripts/build-qemu-robot-docker.sh b/scripts/build-qemu-robot-docker.sh
index 96960dd..581fe8e 100755
--- a/scripts/build-qemu-robot-docker.sh
+++ b/scripts/build-qemu-robot-docker.sh
@@ -10,6 +10,8 @@
set -uo pipefail
+http_proxy=${http_proxy:-}
+
DOCKER_IMG_NAME=${1:-"openbmc/ubuntu-robot-qemu"}
DISTRO=${2:-"ubuntu:bionic"}
@@ -118,5 +120,10 @@
################################# docker img # #################################
+PROXY_ARGS=""
+if [[ -n "${http_proxy}" ]]; then
+ PROXY_ARGS="--build-arg http_proxy=${http_proxy} --build-arg https_proxy=${http_proxy}"
+fi
+
# Build above image
-docker build -t ${DOCKER_IMG_NAME} - <<< "${Dockerfile}"
+docker build ${PROXY_ARGS} -t ${DOCKER_IMG_NAME} - <<< "${Dockerfile}"