diff options
author | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2019-09-02 10:21:12 +0300 |
---|---|---|
committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2019-09-03 18:26:45 +0300 |
commit | 8e18030b0312b1a5f4d7dfe305690e6b9c09cea8 (patch) | |
tree | 95c768a090e0775fe8647cc10d8d89f71addb6ff /.gitlab-ci | |
parent | 2a894cfeaefd359edc37182508cae2219612eabd (diff) |
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 <arkadiusz.hiler@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x | .gitlab-ci/pull-or-rebuild.sh | 5 |
1 files changed, 3 insertions, 2 deletions
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 |