From 6a755c672e7d9cba37749a88e2c53e08c17d17b2 Mon Sep 17 00:00:00 2001 From: Nitesh Konkar Date: Mon, 27 Aug 2018 08:27:28 +0530 Subject: [PATCH] obs-packaging: Build and run Dockerfile based on GOARCH Currently, since GOARCH is not passed as build-arg to a Dockerfile, it by default always pick's up amd64 when building it. Also pass it as --env when running it. Fixes #148 Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com --- obs-packaging/build_from_docker.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/obs-packaging/build_from_docker.sh b/obs-packaging/build_from_docker.sh index aa43757ca..132e360ae 100755 --- a/obs-packaging/build_from_docker.sh +++ b/obs-packaging/build_from_docker.sh @@ -34,6 +34,7 @@ docker_run() { -v "${HOME}/.ssh":/root/.ssh \ -v "${HOME}/.gitconfig":/root/.gitconfig \ -v /etc/profile:/etc/profile \ + --env GO_ARCH="${GO_ARCH}" \ --env http_proxy="${http_proxy}" \ --env https_proxy="${https_proxy}" \ --env no_proxy="${no_proxy}" \ @@ -71,6 +72,7 @@ main() { sudo docker build \ --build-arg http_proxy="${http_proxy}" \ --build-arg https_proxy="${https_proxy}" \ + --build-arg GO_ARCH="${GO_ARCH}" \ -t $obs_image "${script_dir}" #Create/update OBS repository for branch