docker-restic-cron/hooks/post_push

20 lines
611 B
Plaintext
Raw Normal View History

2020-02-11 01:49:39 +00:00
#!/bin/bash
# Use manifest-tool to create the manifest, given the experimental
# "docker manifest" command isn't available yet on Docker Hub.
2020-02-11 02:36:33 +00:00
TAG_ROOT=${DOCKER_TAG%-*}
TARGET_ARCH=${DOCKER_TAG##*-}
if [[ "$TARGET_ARCH" == "latest" ]]; then
echo "Building a non-arch tag. Skip manifest push"
exit 0
fi
2020-02-11 01:49:39 +00:00
curl -Lo manifest-tool https://github.com/estesp/manifest-tool/releases/download/v0.9.0/manifest-tool-linux-amd64
chmod +x manifest-tool
2020-02-11 02:36:33 +00:00
./manifest-tool push from-args \
--platforms "linux/$TARGET_ARCH" \
--template "$DOCKER_REPO:${TAG_ROOT}-ARCH" \
--target "$DOCKER_REPO:${TAG_ROOT}"