Skip to content

Commit db797ee

Browse files
committed
fix: set base image to scratch
The org.opencontainers.image.base.name should not reference images used to generate the contents of the image. The base image we have in the FROM statement is scratch. Signed-off-by: Francesco Canovai <[email protected]>
1 parent 3956a24 commit db797ee

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/bake_targets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ jobs:
158158
EXT_IMAGE: ${{ matrix.image }}
159159
run: |
160160
# Get the PG base image
161-
PG_IMAGE=$(skopeo inspect "docker://$EXT_IMAGE" -f '{{ json .Labels }}' | jq -r '."org.opencontainers.image.base.name"')
161+
PG_IMAGE=$(skopeo inspect "docker://$EXT_IMAGE" -f '{{ json .Labels }}' | jq -r '."io.cloudnativepg.image.base.name"')
162162
163163
# Merge metadata.json with runtime values to generate Chainsaw values.yaml
164164
jq --arg ext_image "$EXT_IMAGE" \

docker-bake.hcl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ target "default" {
7575
"index,manifest:org.opencontainers.image.documentation=${url}",
7676
"index,manifest:org.opencontainers.image.authors=${authors}",
7777
"index,manifest:org.opencontainers.image.licenses=Apache-2.0",
78-
"index,manifest:org.opencontainers.image.base.name=${getBaseImage(distro, pgVersion)}",
78+
"index,manifest:org.opencontainers.image.base.name=scratch",
79+
"index,manifest:io.cloudnativepg.image.base.name=${getBaseImage(distro, pgVersion)}",
7980
]
8081
labels = {
8182
"org.opencontainers.image.created" = "${now}",
@@ -88,8 +89,9 @@ target "default" {
8889
"org.opencontainers.image.description" = "A ${metadata.name} ${pgVersion}-${getExtensionVersion(distro, pgVersion)} container image",
8990
"org.opencontainers.image.documentation" = "${url}",
9091
"org.opencontainers.image.authors" = "${authors}",
91-
"org.opencontainers.image.licenses" = "Apache-2.0"
92-
"org.opencontainers.image.base.name" = "${getBaseImage(distro, pgVersion)}"
92+
"org.opencontainers.image.licenses" = "Apache-2.0",
93+
"org.opencontainers.image.base.name" = "scratch",
94+
"io.cloudnativepg.image.base.name" = "${getBaseImage(distro, pgVersion)}",
9395
}
9496
}
9597

0 commit comments

Comments
 (0)