Skip to content

Commit

Permalink
[build.sh] use multiple tags in the build command and build the alpin…
Browse files Browse the repository at this point in the history
…e image
  • Loading branch information
mdawar committed Jan 5, 2019
1 parent 8c89e53 commit 15aadb1
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,31 @@ echo "docker login done"
export BUILD_ARGS="--rm=false --build-arg TAG=${CIRCLE_TAG} --build-arg SHA1=${CIRCLE_SHA1} --build-arg DATE=$(date +%F-%T)"
echo "BUILD_ARGS: $BUILD_ARGS"

docker build -t "21zoo/redis_exporter:$CIRCLE_TAG" $BUILD_ARGS .
docker push "21zoo/redis_exporter:$CIRCLE_TAG"

docker build -t "21zoo/redis_exporter:latest" $BUILD_ARGS .
docker push "21zoo/redis_exporter:latest"

docker build -t "oliver006/redis_exporter:$CIRCLE_TAG" $BUILD_ARGS .
docker push "oliver006/redis_exporter:$CIRCLE_TAG"

docker build -t "oliver006/redis_exporter:latest" $BUILD_ARGS .
docker push "oliver006/redis_exporter:latest"

# Scratch image
docker build --target scratch \
-t "21zoo/redis_exporter:$CIRCLE_TAG" \
-t "21zoo/redis_exporter:latest" \
-t "oliver006/redis_exporter:$CIRCLE_TAG" \
-t "oliver006/redis_exporter:latest" \
$BUILD_ARGS .

docker push "21zoo/redis_exporter:$CIRCLE_TAG"
docker push "21zoo/redis_exporter:latest"
docker push "oliver006/redis_exporter:$CIRCLE_TAG"
docker push "oliver006/redis_exporter:latest"

# Alpine image
docker build --target alpine \
-t "21zoo/redis_exporter:$CIRCLE_TAG-alpine" \
-t "21zoo/redis_exporter:alpine" \
-t "oliver006/redis_exporter:$CIRCLE_TAG-alpine" \
-t "oliver006/redis_exporter:alpine" \
$BUILD_ARGS .

docker push "21zoo/redis_exporter:$CIRCLE_TAG-alpine"
docker push "21zoo/redis_exporter:alpine"
docker push "oliver006/redis_exporter:$CIRCLE_TAG-alpine"
docker push "oliver006/redis_exporter:alpine"


echo "Building binaries for Github"
Expand Down

0 comments on commit 15aadb1

Please sign in to comment.