[Docker] Add git branch as an argument to the dockerfile at build time
[releng.git] / 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