Skip to content

Commit 7d22b72

Browse files
committed
Fix Docker push
It seems we need to use `docker import` with the output from `docker buildx` rather than `docker load` like we were doing when we used `docker save`.
1 parent 52579f1 commit 7d22b72

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

ci/steps/push-docker-manifest.sh

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4+
# Import and push the Docker image for the provided arch.
5+
push() {
6+
local arch=$1 ; shift
7+
local tag="codercom/code-server-$arch:$VERSION"
8+
9+
docker import "./release-images/code-server-$arch-$VERSION.tar" "$tag"
10+
11+
# We have to ensure the images exists on the remote registry in order to build
12+
# the manifest. We don't put the arch in the tag to avoid polluting the main
13+
# repository. These other repositories are private so they don't pollute our
14+
# organization namespace.
15+
docker push "$tag"
16+
17+
export DOCKER_CLI_EXPERIMENTAL=enabled
18+
19+
docker manifest create "codercom/code-server:$VERSION" \
20+
"codercom/code-server-$arch:$VERSION" \
21+
"codercom/code-server-$arch:$VERSION"
22+
docker manifest push --purge "codercom/code-server:$VERSION"
23+
}
24+
425
main() {
526
cd "$(dirname "$0")/../.."
627
source ./ci/lib.sh
@@ -10,28 +31,8 @@ main() {
1031
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
1132
fi
1233

13-
for img in ./release-images/*; do
14-
docker load -i "$img"
15-
done
16-
17-
# We have to ensure the amd64 and arm64 images exist on the remote registry
18-
# in order to build the manifest.
19-
# We don't put the arch in the tag to avoid polluting the main repository.
20-
# These other repositories are private so they don't pollute our organization namespace.
21-
docker push "codercom/code-server-amd64:$VERSION"
22-
docker push "codercom/code-server-arm64:$VERSION"
23-
24-
export DOCKER_CLI_EXPERIMENTAL=enabled
25-
26-
docker manifest create "codercom/code-server:$VERSION" \
27-
"codercom/code-server-amd64:$VERSION" \
28-
"codercom/code-server-arm64:$VERSION"
29-
docker manifest push --purge "codercom/code-server:$VERSION"
30-
31-
docker manifest create "codercom/code-server:latest" \
32-
"codercom/code-server-amd64:$VERSION" \
33-
"codercom/code-server-arm64:$VERSION"
34-
docker manifest push --purge "codercom/code-server:latest"
34+
push "amd64"
35+
push "arm64"
3536
}
3637

3738
main "$@"

0 commit comments

Comments
 (0)