From 25c138ec37a8feededef72c2abac1f41cb0496e4 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Tue, 18 Apr 2023 13:29:16 +0200 Subject: [PATCH] first few OCI lables --- Dockerfile | 8 ++++++++ Makefile | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 661bc03..aca5dcb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,20 @@ 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 \ && zypper clean -a + COPY entrypoint.sh /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/Makefile b/Makefile index d2a446c..70546fb 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ VERSION=20230411 IMAGENAME=restic REPO=git.rre.nu/jonas +BUILD_TIME := $(shell TZ=UTC date --iso-8601=ns) + SHELL := /bin/bash require_clean_git: @@ -24,7 +26,11 @@ require_clean_git: default: build build: - podman build --build-arg VERSION=$(VERSION) --tag docker.io/bardak/restic:$(VERSION) . + podman build \ + --build-arg VERSION=$(VERSION) \ + --build-arg BUILD_TIME=${BUILD_TIME} \ + --tag docker.io/bardak/restic:$(VERSION) \ + . clean: podman image rm docker.io/bardak/restic:$(VERSION)