From 9f142c15e4a71a47c05f4f9c569e80635ee4c389 Mon Sep 17 00:00:00 2001 From: James Brumond Date: Tue, 15 Aug 2023 18:04:11 -0700 Subject: [PATCH] first commit of rotate-backups container --- .drone.yml | 17 +++++++++++++++++ Dockerfile | 18 ++++++++++++++++++ readme.md | 4 ++++ rotate.sh | 2 ++ 4 files changed, 41 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 readme.md create mode 100644 rotate.sh diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..d73ed11 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,17 @@ +--- +kind: template +load: multiarch-container.yaml +data: + repo: images/rotate-backups + build_args: + - PYTHON_VERSION=3 + - ALPINE_VERSION=3.18 + - ROTATE_BACKUPS_VERSION=8.1 + tags: + - "8.1" + - "8" + platforms: + - os: linux + arch: arm64 + - os: linux + arch: amd64 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e41b3aa --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ + +ARG PYTHON_VERSION=3 +ARG ALPINE_VERSION=3.18 +ARG ROTATE_BACKUPS_VERSION=latest + +FROM python:${PYTHON_VERSION}-alpine${ALPINE_VERSION} + +RUN apk update && apk add less + +RUN pip install rotate-backups==${ROTATE_BACKUPS_VERSION} + +RUN mkdir /data + +COPY rotate.sh /opt/rotate.sh +RUN chmod +x /opt/rotate.sh + +ENTRYPOINT ["/opt/rotate.sh"] +CMD ["--help"] diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..b08bac6 --- /dev/null +++ b/readme.md @@ -0,0 +1,4 @@ + +# `rotate-backups` in a container image + + diff --git a/rotate.sh b/rotate.sh new file mode 100644 index 0000000..eee6530 --- /dev/null +++ b/rotate.sh @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/local/bin/rotate-backups "$@" /data \ No newline at end of file