Merge "[Docker] Add git branch as an argument to the dockerfile at build time"
authorjose.lausuch <jose.lausuch@ericsson.com>
Tue, 6 Sep 2016 12:07:29 +0000 (12:07 +0000)
committerGerrit Code Review <gerrit@172.30.200.206>
Tue, 6 Sep 2016 12:07:29 +0000 (12:07 +0000)
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