From 6c13328ee4c458b92a6678b7aa40d4277cd3dd7b Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Tue, 18 Apr 2023 13:53:24 +0200 Subject: [PATCH] added labels to image --- Dockerfile | 8 -------- Makefile | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index aca5dcb..7f2ea32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,6 @@ ARG VERSION -ARG BUILD_TIME FROM registry.opensuse.org/opensuse/tumbleweed:${VERSION} -LABEL org.opencontainers.image.description=Image containing restic & openSSH, based on openSUSE Tumbleweed -LABEL org.opencontainers.image.source=https://git.rre.nu/jonas/restic/src/tag/${VERSION} -LABEL org.opencontainers.image.title=restic with openSSH based on openSUSE Tumpleweed -LABEL org.opencontainers.image.url=https://git.rre.nu/jonas/-/packages/container/restic/${VERSION} -LABEL org.opencontainers.image.created=${BUILD_TIME} - - RUN zypper --non-interactive install \ openssh-clients \ restic \ diff --git a/Makefile b/Makefile index 70546fb..d41faba 100644 --- a/Makefile +++ b/Makefile @@ -6,11 +6,15 @@ VERSION=20230411 IMAGENAME=restic REPO=git.rre.nu/jonas +TITLE=restic with openSSH based on openSUSE Tumpleweed +DESC=Image containing restic & openSSH, based on openSUSE Tumbleweed BUILD_TIME := $(shell TZ=UTC date --iso-8601=ns) SHELL := /bin/bash +default: build + require_clean_git: git update-index -q --ignore-submodules --refresh git diff-files --quiet --ignore-submodules @@ -23,12 +27,16 @@ require_clean_git: exit 1; \ fi -default: build - build: podman build \ - --build-arg VERSION=$(VERSION) \ - --build-arg BUILD_TIME=${BUILD_TIME} \ + --build-arg VERSION="$(VERSION)" \ + --label org.opencontainers.image.source="https://${REPO}/${IMAGENAME}/src/tag/${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 docker.io/bardak/restic:$(VERSION) \ .