From 589982f027e0f8fe9b1446a59212f78ac79760cc Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 16 Jul 2021 18:25:54 -0500 Subject: [PATCH] Fix incorrect manifest build I mistakenly thought they were for each arch but it's for the version and latest which makes a *lot* more sense. --- ci/steps/push-docker-manifest.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/ci/steps/push-docker-manifest.sh b/ci/steps/push-docker-manifest.sh index e866e606..9399db7e 100755 --- a/ci/steps/push-docker-manifest.sh +++ b/ci/steps/push-docker-manifest.sh @@ -12,25 +12,15 @@ function version_exists() { fi } -# Import and push the Docker image for the provided arch. +# Import and push the Docker image for the provided arch. We must have +# individual arch repositories pushed remotely in order to use `docker +# manifest` to create single a multi-arch image. +# TODO: Switch to buildx? Seems it can do this more simply. push() { local arch=$1 local tag="codercom/code-server-$arch:$VERSION" - docker import "./release-images/code-server-$arch-$VERSION.tar" "$tag" - - # We have to ensure the images exists on the remote registry in order to build - # the manifest. We don't put the arch in the tag to avoid polluting the main - # repository. These other repositories are private so they don't pollute our - # organization namespace. docker push "$tag" - - export DOCKER_CLI_EXPERIMENTAL=enabled - - docker manifest create "codercom/code-server:$VERSION" \ - "codercom/code-server-$arch:$VERSION" \ - "codercom/code-server-$arch:$VERSION" - docker manifest push --purge "codercom/code-server:$VERSION" } main() { @@ -49,6 +39,18 @@ main() { push "amd64" push "arm64" + + export DOCKER_CLI_EXPERIMENTAL=enabled + + docker manifest create "codercom/code-server:$VERSION" \ + "codercom/code-server-amd64:$VERSION" \ + "codercom/code-server-arm64:$VERSION" + docker manifest push --purge "codercom/code-server:$VERSION" + + docker manifest create "codercom/code-server:latest" \ + "codercom/code-server-amd64:$VERSION" \ + "codercom/code-server-arm64:$VERSION" + docker manifest push --purge "codercom/code-server:latest" } main "$@"