From 682c6512245e47f5968818922ff8ede6cbafb3fa Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sat, 26 Aug 2023 10:42:24 +0200 Subject: [PATCH] docker: use OCI labels https://github.com/opencontainers/image-spec/blob/main/annotations.md https://docs.docker.com/engine/reference/builder/#label Before: ```console $ docker image inspect --format='{{json .Config.Labels}}' ghcr.io/vogler/free-games-claimer | jq { "org.opencontainers.image.ref.name": "ubuntu", "org.opencontainers.image.version": "22.04" } ``` After: ```console $ docker image inspect --format='{{json .Config.Labels}}' ghcr.io/vogler/free-games-claimer | jq { "org.opencontainers.image.base.name": "ubuntu:jammy", "org.opencontainers.image.description": "Automatically claims free games on the Epic Games Store, Amazon Prime Gaming and GOG", "org.opencontainers.image.name": "free-games-claimer", "org.opencontainers.image.ref.name": "", "org.opencontainers.image.revision": "", "org.opencontainers.image.source": "https://github.com/vogler/free-games-claimer", "org.opencontainers.image.title": "free-games-claimer", "org.opencontainers.image.url": "https://github.com/vogler/free-games-claimer", "org.opencontainers.image.version": "latest" } ``` --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index ebad9eb..df20609 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,6 +60,16 @@ COPY . . RUN dos2unix *.sh && chmod +x *.sh COPY docker-entrypoint.sh /usr/local/bin/ +LABEL org.opencontainers.image.title="free-games-claimer" \ + org.opencontainers.image.name="free-games-claimer" \ + org.opencontainers.image.description="Automatically claims free games on the Epic Games Store, Amazon Prime Gaming and GOG" \ + org.opencontainers.image.url="https://github.com/vogler/free-games-claimer" \ + org.opencontainers.image.source="https://github.com/vogler/free-games-claimer" \ + org.opencontainers.image.revision=${COMMIT_SHA} \ + org.opencontainers.image.ref.name=${BRANCH} \ + org.opencontainers.image.base.name="ubuntu:jammy" \ + org.opencontainers.image.version="latest" + # Configure VNC via environment variables: ENV VNC_PORT 5900 ENV NOVNC_PORT 6080