From 6d0ce9b6cf5351287e314e621559a106699f55cd Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Mon, 10 Feb 2020 18:36:33 -0800 Subject: [PATCH] Simpler post build manifest --- hooks/post_push | 12 +++++++++++- multi-arch-manifest.yml | 17 ----------------- 2 files changed, 11 insertions(+), 18 deletions(-) delete mode 100644 multi-arch-manifest.yml diff --git a/hooks/post_push b/hooks/post_push index a4e3041..45931a5 100755 --- a/hooks/post_push +++ b/hooks/post_push @@ -3,7 +3,17 @@ # Use manifest-tool to create the manifest, given the experimental # "docker manifest" command isn't available yet on Docker Hub. +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 + curl -Lo manifest-tool https://github.com/estesp/manifest-tool/releases/download/v0.9.0/manifest-tool-linux-amd64 chmod +x manifest-tool -./manifest-tool push from-spec multi-arch-manifest.yml +./manifest-tool push from-args \ + --platforms "linux/$TARGET_ARCH" \ + --template "$DOCKER_REPO:${TAG_ROOT}-ARCH" \ + --target "$DOCKER_REPO:${TAG_ROOT}" diff --git a/multi-arch-manifest.yml b/multi-arch-manifest.yml deleted file mode 100644 index f6c8309..0000000 --- a/multi-arch-manifest.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -image: vividboarder/docker-restic-cron:latest -manifests: - - image: vividboarder/docker-restic-cron:latest-amd64 - platform: - architecture: amd64 - os: linux - - image: vividboarder/docker-restic-cron:latest-arm32v7 - platform: - architecture: arm - os: linux - variant: v7 - - image: vividboarder/docker-restic-cron:latest-arm64v8 - platform: - architecture: arm64 - os: linux - variant: v8