From: jose.lausuch Date: Tue, 6 Sep 2016 09:53:39 +0000 (+0200) Subject: [Docker] Add git branch as an argument to the dockerfile at build time X-Git-Tag: colorado.1.0~73^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=879977651ff80cbc5f3ef5b7f4e4acc53451e30f;p=releng.git [Docker] Add git branch as an argument to the dockerfile at build time This will be useful for the dockerfiles which need to have this as a parameter to clone the respective repositories. Needed for Functest. Related JIRA: FUNCTEST-458 Change-Id: I6c818bdbc6d9935a6bf5274487540309ce1017b6 Signed-off-by: jose.lausuch --- diff --git a/jjb/opnfv/opnfv-docker.sh b/jjb/opnfv/opnfv-docker.sh index ef4738482..860eee05d 100644 --- a/jjb/opnfv/opnfv-docker.sh +++ b/jjb/opnfv/opnfv-docker.sh @@ -110,7 +110,7 @@ echo "Tag version to be build and pushed: $DOCKER_TAG" # Start the build echo "Building docker image: $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG" -docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG . +docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG --build-arg BRANCH=$branch . echo "Creating tag '$DOCKER_TAG'..." docker tag -f $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG $DOCKER_REPO_NAME:$DOCKER_TAG