From 604039a37b41e8fbcebdfd94a0bdced5c209bf62 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Wed, 25 Apr 2018 16:31:28 -0400 Subject: Adding alpine Docker image variant Signed-off-by: Dave Henderson --- hooks/build | 11 +++++++++++ hooks/post_push | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'hooks') 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 -- cgit v1.2.3