[Docker] Add git branch as an argument to the dockerfile at build time 31/20431/1
authorjose.lausuch <jose.lausuch@ericsson.com>
Tue, 6 Sep 2016 09:53:39 +0000 (11:53 +0200)
committerjose.lausuch <jose.lausuch@ericsson.com>
Tue, 6 Sep 2016 09:53:39 +0000 (11:53 +0200)
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 <jose.lausuch@ericsson.com>
jjb/opnfv/opnfv-docker.sh

index ef47384..860eee0 100644 (file)
@@ -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