Compare commits
4 Commits
23615777b7
...
labels
Author | SHA1 | Date | |
---|---|---|---|
25c138ec37 | |||
9bd451d131 | |||
|
3a8dbed8db | ||
|
52d867d7ae |
@@ -1,12 +1,20 @@
|
|||||||
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 \
|
||||||
&& zypper clean -a
|
&& zypper clean -a
|
||||||
|
|
||||||
|
|
||||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||||
|
14
Makefile
14
Makefile
@@ -5,7 +5,9 @@
|
|||||||
|
|
||||||
VERSION=20230411
|
VERSION=20230411
|
||||||
IMAGENAME=restic
|
IMAGENAME=restic
|
||||||
REPO=docker.io/bardak
|
REPO=git.rre.nu/jonas
|
||||||
|
|
||||||
|
BUILD_TIME := $(shell TZ=UTC date --iso-8601=ns)
|
||||||
|
|
||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
|
|
||||||
@@ -24,14 +26,18 @@ require_clean_git:
|
|||||||
default: build
|
default: build
|
||||||
|
|
||||||
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:
|
clean:
|
||||||
podman image rm docker.io/bardak/restic:$(VERSION)
|
podman image rm docker.io/bardak/restic:$(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))
|
||||||
git tag -a v$(VERSION) -m "${TMP_MESSAGE}"
|
git tag -a v$(VERSION) -m "restic version: ${TMP_MESSAGE}"
|
||||||
git push origin v$(VERSION)
|
git push origin v$(VERSION)
|
||||||
podman tag ${REPO}/${IMAGENAME}:$(VERSION) ${REPO}/${IMAGENAME}:latest
|
podman tag ${REPO}/${IMAGENAME}:$(VERSION) ${REPO}/${IMAGENAME}:latest
|
||||||
podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:$(VERSION)
|
podman push --creds $(USERNAME):$(PASSWORD) ${REPO}/${IMAGENAME}:$(VERSION)
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
set -aeou pipefail
|
set -aeou pipefail
|
||||||
|
|
||||||
BASE_IMAGE="registry.opensuse.org/opensuse/tumbleweed"
|
BASE_IMAGE="registry.opensuse.org/opensuse/tumbleweed"
|
||||||
|
TARGET_REPO="git.rre.nu/jonas/"
|
||||||
PACKAGE_NAME="restic"
|
PACKAGE_NAME="restic"
|
||||||
|
|
||||||
echo "Pulling latest tumbleweed"
|
echo "Pulling latest tumbleweed"
|
||||||
@@ -16,7 +17,7 @@ if [[ "$CURRENT_TUMBLEWEED_TAG" == "$LATEST_TUMBLEWEED_TAG" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "New tumbleweed image exists"
|
echo "New tumbleweed image exists"
|
||||||
CURRENT_VERSION="$(podman run --rm -it ${BASE_IMAGE}:${CURRENT_TUMBLEWEED_TAG} /usr/bin/bash -c "zypper ref > /dev/null && zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")"
|
CURRENT_VERSION="$(podman run --rm -it ${TARGET_REPO}${PACKAGE_NAME}:latest /usr/bin/bash -c "zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")"
|
||||||
LATEST_VERSION="$(podman run --rm -it ${BASE_IMAGE}:latest /usr/bin/bash -c "zypper ref > /dev/null && zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")"
|
LATEST_VERSION="$(podman run --rm -it ${BASE_IMAGE}:latest /usr/bin/bash -c "zypper ref > /dev/null && zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")"
|
||||||
|
|
||||||
echo "current : $CURRENT_VERSION"
|
echo "current : $CURRENT_VERSION"
|
||||||
|
Reference in New Issue
Block a user