summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2018-04-25 16:31:28 -0400
committerDave Henderson <dhenderson@gmail.com>2018-04-25 16:31:28 -0400
commit604039a37b41e8fbcebdfd94a0bdced5c209bf62 (patch)
treeabcc8622d1290f42fa90b704dfdbb56d06375604 /hooks
parent6bb146a08237f57ecc21c5ac48d8314aa047a3fa (diff)
Adding alpine Docker image variant
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/build11
-rwxr-xr-xhooks/post_push8
2 files changed, 18 insertions, 1 deletions
diff --git a/hooks/build b/hooks/build
index a01a27ff..977090ae 100755
--- a/hooks/build
+++ b/hooks/build
@@ -29,3 +29,14 @@ docker build --build-arg BUILD_DATE \
--build-arg VCS_REF \
--target gomplate-slim \
-t ${DOCKER_REPO}:${SLIM_TAG} .
+
+if [ "$DOCKER_TAG" == "latest" ]; then
+ export ALPINE_TAG="alpine"
+else
+ export ALPINE_TAG="${DOCKER_TAG}-alpine"
+fi
+echo "======== Building ${DOCKER_REPO}:${ALPINE_TAG}"
+docker build --build-arg BUILD_DATE \
+ --build-arg VCS_REF \
+ --target gomplate-alpine \
+ -t ${DOCKER_REPO}:${ALPINE_TAG} .
diff --git a/hooks/post_push b/hooks/post_push
index 2a0457b7..03e88cac 100755
--- a/hooks/post_push
+++ b/hooks/post_push
@@ -9,11 +9,15 @@ docker push ${DOCKER_REPO}:artifacts
if [ "$DOCKER_TAG" == "latest" ]; then
export SLIM_TAG="slim"
+ export ALPINE_TAG="alpine"
else
export SLIM_TAG="${DOCKER_TAG}-slim"
+ export ALPINE_TAG="${DOCKER_TAG}-alpine"
fi
-# Need to push the slim image too
+
+# Need to push the other images too
docker push $DOCKER_REPO:${SLIM_TAG}
+docker push $DOCKER_REPO:${ALPINE_TAG}
# This magic figures out if we're currently on a tag (i.e. a release).
# We only want to have special tags for releases.
@@ -21,6 +25,8 @@ if (git describe --abbrev=0 --exact-match &>/dev/null); then
tag=$(git describe --abbrev=0 --exact-match)
docker tag $IMAGE_NAME $DOCKER_REPO:$tag
docker tag $DOCKER_REPO:${SLIM_TAG} $DOCKER_REPO:${tag}-slim
+ docker tag $DOCKER_REPO:${ALPINE_TAG} $DOCKER_REPO:${tag}-alpine
docker push $DOCKER_REPO:$tag
docker push $DOCKER_REPO:${tag}-slim
+ docker push $DOCKER_REPO:${tag}-alpine
fi