docker-restic-cron/hooks/build

39 lines
587 B
Plaintext
Raw Permalink Normal View History

2020-02-11 01:49:39 +00:00
#!/bin/bash
set -ex
# Extract arch repo from a docker tag suffix
REPO=""
case "$DOCKER_TAG" in
*amd64)
REPO="library"
;;
*arm32v5)
REPO="arm32v5"
;;
*arm32v6)
REPO="arm32v6"
;;
*arm32v7)
REPO="arm32v7"
;;
*arm64v8)
REPO="arm64v8"
;;
*i386)
REPO="i386"
;;
*ppc64le)
REPO="ppc64le"
;;
*s390x)
REPO="s390x"
;;
*)
REPO="library"
;;
esac
docker build \
--build-arg REPO="$REPO" \
--tag "$IMAGE_NAME" .