1
1
#! /usr/bin/env bash
2
2
set -euo pipefail
3
3
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
+
4
25
main () {
5
26
cd " $( dirname " $0 " ) /../.."
6
27
source ./ci/lib.sh
@@ -10,28 +31,8 @@ main() {
10
31
echo " $DOCKER_PASSWORD " | docker login -u " $DOCKER_USERNAME " --password-stdin
11
32
fi
12
33
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"
35
36
}
36
37
37
38
main " $@ "
0 commit comments