Add additional opencontainers labels, fix version id

This commit is contained in:
Justin Kromlinger 2023-06-08 20:18:07 +02:00
parent 4afa2a09af
commit 74dc761af8
No known key found for this signature in database
GPG Key ID: 69EF6D9E49A64EB8
3 changed files with 20 additions and 1 deletions

View File

@ -227,7 +227,10 @@ release:
sed -i "s|TEMPLATE_ROOTFS_RELEASE_URL|https://gitlab.archlinux.org/archlinux/archlinux-docker/-/releases/v${BUILD_VERSION}|" output/Dockerfile.${group}
sed -i "s|TEMPLATE_ROOTFS_DOWNLOAD|ROOTFS=\"\$(curl -sOJL -w \"%{filename_effective}\" \"${package_url}\")\"|" output/Dockerfile.${group}
sed -i "s|TEMPLATE_ROOTFS_HASH|$(cat output/${group}.tar.zst.SHA256)|" output/Dockerfile.${group}
sed -i "s|TEMPLATE_ROOTFS_VERSION|${BUILD_VERSION}|" output/Dockerfile.${group}
sed -i "s|TEMPLATE_TITLE|Arch Linux ${group} Image" output/Dockerfile.${group}
sed -i "s|TEMPLATE_VERSION_ID|${BUILD_VERSION}|" output/Dockerfile.${group}
sed -i "s|TEMPLATE_REVISION|${CI_COMMIT_SHA}|" output/Dockerfile.${group}
sed -i "s|TEMPLATE_CREATED|$(date -Is)|" output/Dockerfile.${group}
done
- >
curl -sSf --request POST -o commit-response.json

View File

@ -8,6 +8,7 @@
# The second stage is for actually configuring the system a little bit.
# Some templating is done in order to allow us to easily build different configurations and to
# allow us to automate the release process.
FROM alpine:3.18 AS verify
COPY TEMPLATE_ROOTFS_FILE /
RUN apk add --no-cache curl tar zstd
@ -21,6 +22,18 @@ RUN TEMPLATE_ROOTFS_DOWNLOAD && \
tar -C /rootfs --extract --file "${ROOTFS}"
FROM scratch AS root
LABEL org.opencontainers.image.title="TEMPLATE_TITLE"
LABEL org.opencontainers.image.description="Official containerd image of Arch Linux, a simple, lightweight Linux distribution aimed for flexibility."
LABEL org.opencontainers.image.authors="Santiago Torres-Arias <santiago@archlinux.org> (@SantiagoTorres), Christian Rebischke <Chris.Rebischke@archlinux.org> (@shibumi), Justin Kromlinger <hashworks@archlinux.org> (@hashworks)"
LABEL org.opencontainers.image.url="https://gitlab.archlinux.org/archlinux/archlinux-docker/-/blob/master/README.md"
LABEL org.opencontainers.image.documentation="https://wiki.archlinux.org/title/Docker#Arch_Linux"
LABEL org.opencontainers.image.source="https://gitlab.archlinux.org/archlinux/archlinux-docker"
LABEL org.opencontainers.image.licenses="GPL-3.0-or-later"
LABEL org.opencontainers.image.version="TEMPLATE_VERSION_ID"
LABEL org.opencontainers.image.revision="TEMPLATE_REVISION"
LABEL org.opencontainers.image.created="TEMPLATE_CREATED"
COPY --from=verify /rootfs/ /
RUN ldconfig && \

View File

@ -41,7 +41,10 @@ define dockerfile
-e "s|TEMPLATE_ROOTFS_RELEASE_URL|Local build|" \
-e "s|TEMPLATE_ROOTFS_DOWNLOAD|ROOTFS=\"$(1).tar.zst\"|" \
-e "s|TEMPLATE_ROOTFS_HASH|$$(cat $(OUTPUTDIR)/$(1).tar.zst.SHA256)|" \
-e "s|TEMPLATE_TITLE|Arch Linux Dev Image|" \
-e "s|TEMPLATE_VERSION_ID|dev|" \
-e "s|TEMPLATE_REVISION|$$(git rev-parse HEAD)|" \
-e "s|TEMPLATE_CREATED|$$(date -Is)|" \
Dockerfile.template > $(OUTPUTDIR)/Dockerfile.$(1)
endef