forked from GoogleContainerTools/distroless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild_cosign.sh
executable file
·52 lines (42 loc) · 2.16 KB
/
cloudbuild_cosign.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
#!/busybox/sh
set -o errexit
set -o xtrace
cosign version
# Sign all images from 'images' file
cosign --timeout 20m sign "$@" $(cat images)
# Sign 'latest' images with cosign
for distro_suffix in "" -debian10 -debian11; do
cosign sign "$@" gcr.io/$PROJECT_ID/static${distro_suffix}:nonroot
cosign sign "$@" gcr.io/$PROJECT_ID/static${distro_suffix}:latest
cosign sign "$@" gcr.io/$PROJECT_ID/static${distro_suffix}:debug-nonroot
cosign sign "$@" gcr.io/$PROJECT_ID/static${distro_suffix}:debug
cosign sign "$@" gcr.io/$PROJECT_ID/base${distro_suffix}:nonroot
cosign sign "$@" gcr.io/$PROJECT_ID/base${distro_suffix}:latest
cosign sign "$@" gcr.io/$PROJECT_ID/base${distro_suffix}:debug-nonroot
cosign sign "$@" gcr.io/$PROJECT_ID/base${distro_suffix}:debug
cosign sign "$@" gcr.io/$PROJECT_ID/cc${distro_suffix}:nonroot
cosign sign "$@" gcr.io/$PROJECT_ID/cc${distro_suffix}:latest
cosign sign "$@" gcr.io/$PROJECT_ID/cc${distro_suffix}:debug-nonroot
cosign sign "$@" gcr.io/$PROJECT_ID/cc${distro_suffix}:debug
done
# python, java and nodejs are debian11 only
for distro_suffix in "" -debian11; do
cosign sign "$@" gcr.io/$PROJECT_ID/python3${distro_suffix}:nonroot
cosign sign "$@" gcr.io/$PROJECT_ID/python3${distro_suffix}:latest
cosign sign "$@" gcr.io/$PROJECT_ID/python3${distro_suffix}:debug-nonroot
cosign sign "$@" gcr.io/$PROJECT_ID/python3${distro_suffux}:debug
done
for distro_suffix in "" -debian11; do
cosign sign "$@" gcr.io/$PROJECT_ID/nodejs${distro_suffix}:latest
cosign sign "$@" gcr.io/$PROJECT_ID/nodejs${distro_suffix}:debug
cosign sign "$@" gcr.io/$PROJECT_ID/nodejs${distro_suffix}:18
cosign sign "$@" gcr.io/$PROJECT_ID/nodejs${distro_suffix}:18-debug
cosign sign "$@" gcr.io/$PROJECT_ID/nodejs${distro_suffix}:16
cosign sign "$@" gcr.io/$PROJECT_ID/nodejs${distro_suffix}:16-debug
done
for java_version in -base 11 17; do
cosign sign "$@" gcr.io/$PROJECT_ID/java${java_version}-debian11:latest
cosign sign "$@" gcr.io/$PROJECT_ID/java${java_version}-debian11:nonroot
cosign sign "$@" gcr.io/$PROJECT_ID/java${java_version}-debian11:debug
cosign sign "$@" gcr.io/$PROJECT_ID/java${java_version}-debian11:debug-nonroot
done