-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrecreate-jdk-manifests.sh
executable file
·57 lines (43 loc) · 1.36 KB
/
recreate-jdk-manifests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
#
# Run this after uploading a new image to docker hub, to recreate the manifest to point to the
# new image for each architecture
#
if [ "$#" -ne 3 ]; then
echo "Script expects parameters <jdk-variant> <modules> <version>"
exit 1
fi
variant=$1
modules=$2
version=$3
if [ $variant = "client" ]; then
variant_id="-cl"
modules=all
elif [ $variant = "server" ]; then
variant_id="-sv"
modules=all
else
variant_id="" # custom
fi
if [ $modules = "all" ]; then
modules_id=""
else
modules_id=$(echo "-"$modules | sed "s/java\.//g" | sed "s/,/-/g")
fi
image=openjdk${variant_id}${modules_id}-alpine
echo "recreating tags for calimeroproject/$image..."
# we need to update tags with name "latest" and <version> (e.g., 17, 21)
docker manifest rm calimeroproject/$image:$version
docker manifest create \
calimeroproject/$image:$version \
--amend calimeroproject/$image:$version-amd64 \
--amend calimeroproject/$image:$version-armv7 \
--amend calimeroproject/$image:$version-aarch64
docker manifest push calimeroproject/$image:$version
docker manifest rm calimeroproject/$image:latest
docker manifest create \
calimeroproject/$image:latest \
--amend calimeroproject/$image:latest-amd64 \
--amend calimeroproject/$image:latest-armv7 \
--amend calimeroproject/$image:latest-aarch64
docker manifest push calimeroproject/$image:latest