Compare commits
6 Commits
23615777b7
...
v20230411
Author | SHA1 | Date | |
---|---|---|---|
|
24143adf8a | ||
|
6c13328ee4 | ||
25c138ec37 | |||
9bd451d131 | |||
|
3a8dbed8db | ||
|
52d867d7ae |
@@ -1,12 +1,12 @@
|
|||||||
ARG VERSION
|
ARG VERSION
|
||||||
FROM registry.opensuse.org/opensuse/tumbleweed:${VERSION}
|
FROM registry.opensuse.org/opensuse/tumbleweed:${VERSION}
|
||||||
|
|
||||||
|
|
||||||
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"]
|
||||||
|
28
Makefile
28
Makefile
@@ -5,10 +5,16 @@
|
|||||||
|
|
||||||
VERSION=20230411
|
VERSION=20230411
|
||||||
IMAGENAME=restic
|
IMAGENAME=restic
|
||||||
REPO=docker.io/bardak
|
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
|
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
|
||||||
@@ -21,17 +27,25 @@ require_clean_git:
|
|||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
default: build
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
podman build --build-arg VERSION=$(VERSION) --tag docker.io/bardak/restic:$(VERSION) .
|
podman build \
|
||||||
|
--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) \
|
||||||
|
.
|
||||||
|
|
||||||
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))
|
||||||
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