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
This commit is contained in:
Nitesh Konkar 2018-08-27 08:27:28 +05:30
parent ee6ef0954a
commit 6a755c672e

View File

@ -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