From be5349c05a4f7fa63157a22ab741d378cc7e7009 Mon Sep 17 00:00:00 2001 From: Michael Frister Date: Tue, 12 Nov 2019 11:40:37 +0100 Subject: [PATCH 1/2] Docker image: Add source code reference label This allows tools that automate component updates (in our case Renovate Bot [1]) to automatically find the source repository for the Docker image and extract release notes from there. Renovate Bot can include the relevant release notes automatically in a merge request changing the component version. In [2], Renovate added the label for their own Docker image. [1] https://github.com/renovatebot/renovate [2] https://github.com/renovatebot/renovate/pull/3753 --- rootfs/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile index 5b00513a6..bd9498edf 100644 --- a/rootfs/Dockerfile +++ b/rootfs/Dockerfile @@ -14,6 +14,8 @@ FROM BASEIMAGE +LABEL org.opencontainers.image.source="https://github.com/kubernetes/ingress-nginx" + CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ WORKDIR /etc/nginx From dea9c405e5fc7f8ce859ead798c451e69059d8e4 Mon Sep 17 00:00:00 2001 From: Michael Frister Date: Mon, 18 Nov 2019 10:20:20 +0100 Subject: [PATCH 2/2] Docker image: Add more opencontainers labels (incl. version) --- Makefile | 1 + rootfs/Dockerfile | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Makefile b/Makefile index f8f3c5e57..31dc3a901 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,7 @@ container: clean-container .container-$(ARCH) cp -RP ./* $(TEMP_DIR) $(SED_I) "s|BASEIMAGE|$(BASEIMAGE)|g" $(DOCKERFILE) $(SED_I) "s|QEMUARCH|$(QEMUARCH)|g" $(DOCKERFILE) + $(SED_I) "s|VERSION|$(TAG)|g" $(DOCKERFILE) ifeq ($(ARCH),amd64) # When building "normally" for amd64, remove the whole line, it has no part in the amd64 image diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile index bd9498edf..d93701db7 100644 --- a/rootfs/Dockerfile +++ b/rootfs/Dockerfile @@ -14,7 +14,12 @@ FROM BASEIMAGE +LABEL org.opencontainers.image.title='NGINX Ingress Controller for Kubernetes' +LABEL org.opencontainers.image.documentation='https://kubernetes.github.io/ingress-nginx/' LABEL org.opencontainers.image.source="https://github.com/kubernetes/ingress-nginx" +LABEL org.opencontainers.image.vendor='The Kubernetes Authors' +LABEL org.opencontainers.image.licenses='Apache-2.0' +LABEL org.opencontainers.image.version='VERSION' CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/