docker: fix image annotations;

docker buildx imagetools inspect copyparty/ac:beta@sha256:[...] --raw
would show the annotations from the base alpine image instead of ours

thx to @EmilyxFox for figuring this out!
This commit is contained in:
ed 2025-09-06 23:44:48 +00:00
parent 3bdef75e88
commit ab56238249

View file

@ -102,12 +102,18 @@ filt=
# arm takes forever so make it top priority # arm takes forever so make it top priority
[ ${a::3} == arm ] && nice= || nice=-n20 [ ${a::3} == arm ] && nice= || nice=-n20
# not sure if this is necessary or if inherit-annotations=false was enough, but won't hurt
readarray -t annot < <(awk <Dockerfile.$i '/org.opencontainers.image/{sub(/[^\.]+/,"");sub(/[" \\]+$/,"");sub(/"/,"");print"--annotation";print"org"$0}')
annot+=( --annotation "org.opencontainers.image.created=$( date -u +%Y-%m-%dT%H:%M:%SZ )" )
# --pull=never does nothing at all btw # --pull=never does nothing at all btw
(set -x (set -x
nice $nice podman build \ nice $nice podman build \
--squash \ --squash \
--pull=never \ --pull=never \
--from localhost/alpine-$a \ --from localhost/alpine-$a \
--inherit-annotations=false \
"${annot[@]}" \
-t copyparty-$i-$a$suf \ -t copyparty-$i-$a$suf \
-f Dockerfile.$i . || -f Dockerfile.$i . ||
(echo $? $i-$a >> err; printf '%096d\n' $(seq 1 42)) (echo $? $i-$a >> err; printf '%096d\n' $(seq 1 42))