Add support for Docker container build behind proxy
Change-Id: I380f7b20f04ad81b487ccc3cafe37a38360dcf00
diff --git a/containers/onboarding_synchronizer/Makefile b/containers/onboarding_synchronizer/Makefile
index 6532196..c6d2a6b 100644
--- a/containers/onboarding_synchronizer/Makefile
+++ b/containers/onboarding_synchronizer/Makefile
@@ -2,8 +2,16 @@
CONTAINER_NAME:=xos-synchronizer
NO_DOCKER_CACHE?=false
+BUILD_ARGS =
+ifdef http_proxy
+BUILD_ARGS += --build-arg http_proxy=${http_proxy}
+endif
+ifdef https_proxy
+BUILD_ARGS += --build-arg https_proxy=${https_proxy}
+endif
+
.PHONY: build
-build: ; sudo docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} .
+build: ; sudo docker build --no-cache=${NO_DOCKER_CACHE} --rm -t ${IMAGE_NAME} ${BUILD_ARGS} .
.PHONY: run
run: ; sudo docker run -d --name ${CONTAINER_NAME} -v /usr/local/share/ca-certificates:/usr/local/share/ca-certificates:ro ${IMAGE_NAME}