From 8e18030b0312b1a5f4d7dfe305690e6b9c09cea8 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Mon, 2 Sep 2019 10:21:12 +0300 Subject: Dockerfile: Make sure that we use correct base image Correct one = the one tagged with current commit, so in case of parallel pipelines we don't take the wrong "latest". Signed-off-by: Arkadiusz Hiler Reviewed-by: Petri Latvala --- .gitlab-ci/pull-or-rebuild.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '.gitlab-ci') diff --git a/.gitlab-ci/pull-or-rebuild.sh b/.gitlab-ci/pull-or-rebuild.sh index 182c8d49..9f33b414 100755 --- a/.gitlab-ci/pull-or-rebuild.sh +++ b/.gitlab-ci/pull-or-rebuild.sh @@ -44,8 +44,9 @@ if [ $IMAGE_PRESENT -eq 0 ] && [ ${FORCE_REBUILD:-0} -eq 0 ] ; then docker tag $DOCKERNAME $COMMITNAME else echo "Building $NAME:$TAG" - docker build -t $DOCKERNAME -t $NAME \ - -t $REFNAME -t $COMMITNAME -f $DOCKERFILE . + docker build --build-arg=CI_COMMIT_SHA=$CI_COMMIT_SHA \ + -t $DOCKERNAME -t $NAME \ + -t $REFNAME -t $COMMITNAME -f $DOCKERFILE . docker push $DOCKERNAME fi docker push $REFNAME -- cgit v1.2.3