2 Commits

Author SHA1 Message Date
Jonas Forsberg
24143adf8a fixed clean tag to use variable 2023-04-18 13:56:01 +02:00
Jonas Forsberg
6c13328ee4 added labels to image 2023-04-18 13:53:24 +02:00
2 changed files with 13 additions and 13 deletions

View File

@@ -1,14 +1,6 @@
ARG VERSION ARG VERSION
ARG BUILD_TIME
FROM registry.opensuse.org/opensuse/tumbleweed:${VERSION} 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 \ RUN zypper --non-interactive install \
openssh-clients \ openssh-clients \
restic \ restic \

View File

@@ -6,11 +6,15 @@
VERSION=20230411 VERSION=20230411
IMAGENAME=restic IMAGENAME=restic
REPO=git.rre.nu/jonas 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) BUILD_TIME := $(shell TZ=UTC date --iso-8601=ns)
SHELL := /bin/bash SHELL := /bin/bash
default: build
require_clean_git: require_clean_git:
git update-index -q --ignore-submodules --refresh git update-index -q --ignore-submodules --refresh
git diff-files --quiet --ignore-submodules git diff-files --quiet --ignore-submodules
@@ -23,17 +27,21 @@ require_clean_git:
exit 1; \ exit 1; \
fi fi
default: build
build: build:
podman build \ podman build \
--build-arg VERSION=$(VERSION) \ --build-arg VERSION="$(VERSION)" \
--build-arg BUILD_TIME=${BUILD_TIME} \ --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) \ --tag docker.io/bardak/restic:$(VERSION) \
. .
clean: clean:
podman image rm docker.io/bardak/restic:$(VERSION) podman image rm ${REPO}/${IMAGENAME}:$(VERSION)
release: require_clean_git build release: require_clean_git build
$(eval TMP_MESSAGE := $(shell podman run --rm -it ${REPO}/${IMAGENAME}:$(VERSION) /usr/bin/restic --version)) $(eval TMP_MESSAGE := $(shell podman run --rm -it ${REPO}/${IMAGENAME}:$(VERSION) /usr/bin/restic --version))