From 10a2ad7b390c48a06ed7258041f4821bbd463520 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Tue, 18 Apr 2023 14:20:21 +0200 Subject: [PATCH] added image labels --- Makefile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1a0cf04..ef06c03 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,11 @@ -include .env -VERSION=20230411 +VERSION=20230416 IMAGENAME=dnsmasq REPO=git.rre.nu/jonas +TITLE=dnsmasq based on openSUSE Tumpleweed +DESC=Image containing dnsmasq, based on openSUSE Tumbleweed SHELL := /bin/bash @@ -22,9 +24,18 @@ require_clean_git: exit 1; \ fi - build: - podman build --build-arg VERSION=$(VERSION) --tag ${REPO}/${IMAGENAME}:$(VERSION) . + podman build \ + --build-arg VERSION="$(VERSION)" \ + --label org.opencontainers.image.source="https://${REPO}/${IMAGENAME}/src/tag/v${VERSION}" \ + --label org.opencontainers.image.title="${TITLE}" \ + --label org.opencontainers.image.description="${DESC}" \ + --label org.opencontainers.image.created="$(shell TZ=UTC date --iso-8601=ns)" \ + --label org.opencontainers.image.url="https://${REPO}/-/packages/container/${IMAGENAME}/${VERSION}" \ + --label org.opencontainers.image.version="${VERSION}" \ + --label org.opencontainers.image.vendor="Jonas Forsberg" \ + --tag ${REPO}/${IMAGENAME}:$(VERSION) \ + . clean: podman image rm ${REPO}/${IMAGENAME}:$(VERSION) @@ -34,5 +45,6 @@ release: require_clean_git build git tag -a v$(VERSION) -m "dnsmasq version: ${TMP_MESSAGE}" git push origin v$(VERSION) podman tag ${REPO}/${IMAGENAME}:$(VERSION) ${REPO}/${IMAGENAME}:latest - podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:$(VERSION) - podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:latest + @ echo "Pushing images" + @ podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:$(VERSION) + @ podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:latest