forked from GoogleContainerTools/distroless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild_cosign.sh
executable file
·40 lines (30 loc) · 1.76 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
#!/bin/sh
set -o errexit
set -o xtrace
export KMS_VAL=gcpkms://projects/$PROJECT_ID/locations/global/keyRings/cosign/cryptoKeys/cosign
cosign version
# Sign images with cosign
for distro_suffix in "" -debian10 -debian11; do
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/static${distro_suffix}:nonroot
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/static${distro_suffix}:latest
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/static${distro_suffix}:debug-nonroot
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/static${distro_suffix}:debug
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/base${distro_suffix}:nonroot
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/base${distro_suffix}:latest
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/base${distro_suffix}:debug-nonroot
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/base${distro_suffix}:debug
done
for distro_suffix in "" -debian10; do
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/cc${distro_suffix}:nonroot
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/cc${distro_suffix}:latest
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/cc${distro_suffix}:debug-nonroot
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/cc${distro_suffix}:debug
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/python2.7${distro_suffix}:latest
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/python2.7${distro_suffix}:debug
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/python3${distro_suffix}:nonroot
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/python3${distro_suffix}:latest
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/python3${distro_suffix}:debug-nonroot
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/python3${distro_suffix}:debug
done
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/nodejs:latest
cosign sign -key $KMS_VAL gcr.io/$PROJECT_ID/nodejs:debug