Skip to content

Commit

Permalink
chore(docker): enable building/pushing multiple image tags per Docker…
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
JordanSussman committed Sep 12, 2018
1 parent 03bee1a commit 3398a69
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docker/hooks/build
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/bin/bash -xe
DOCKER_PATH=$(echo $DOCKERFILE_PATH | sed -e 's/.*\///g')

# loop over comma sepeated list of tags
for tag in ${DOCKER_TAG//,/ }
do
# build string for multiple tags
TAGS="$TAGS -t $DOCKER_REPO:$tag"
done

docker build \
--build-arg "SOURCE_BRANCH=$SOURCE_BRANCH" \
--build-arg "SOURCE_COMMIT=$SOURCE_COMMIT" \
-f $DOCKER_PATH \
-t $IMAGE_NAME ../
-f "$DOCKER_PATH" \
"$TAGS" ../

0 comments on commit 3398a69

Please sign in to comment.