diff options
author | 2025-05-08 13:40:23 -0700 | |
---|---|---|
committer | 2025-05-08 13:40:23 -0700 | |
commit | 7d1b75c5e27f19d7466c809e681e70bbe2506cf5 (patch) | |
tree | 33fb77c7a96925e1e0cbff2ce4216dbadc5e0ebf | |
parent | 58835e6df662ce275775de9e04cf400140ae82e5 (diff) | |
parent | 648be94a090ce63776ecbf56c64e4a1fd14a17b2 (diff) | |
download | containers-7d1b75c5e27f19d7466c809e681e70bbe2506cf5.tar.gz containers-7d1b75c5e27f19d7466c809e681e70bbe2506cf5.tar.zst containers-7d1b75c5e27f19d7466c809e681e70bbe2506cf5.zip |
Merge pull request #24 from ansg191-lab/tarsnappertarsnapper-v0.5.0.1
-rw-r--r-- | containers/tarsnapper/Dockerfile | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/containers/tarsnapper/Dockerfile b/containers/tarsnapper/Dockerfile new file mode 100644 index 0000000..03c7f6d --- /dev/null +++ b/containers/tarsnapper/Dockerfile @@ -0,0 +1,36 @@ +FROM ghcr.io/ansg191-lab/containers/tarsnap:v1.0.41.2 AS tarsnap-base + +FROM python:3.13.1-alpine3.21 + +# Prevents Python from writing pyc files. +ENV PYTHONDONTWRITEBYTECODE=1 + +# Keeps Python from buffering stdout and stderr to avoid situations where +# the application crashes without emitting any logs due to buffering. +ENV PYTHONUNBUFFERED=1 + +# Create a non-privileged user +ARG UID=10001 +RUN adduser \ + --disabled-password \ + --gecos "" \ + --home "/nonexistent" \ + --shell "/sbin/nologin" \ + --no-create-home \ + --uid "${UID}" \ + appuser + +# Copy tarsnap binary and config from tarsnap-base +WORKDIR /app +COPY --from=tarsnap-base /usr/local/bin/* /usr/local/bin/ +COPY --from=tarsnap-base /app/etc/tarsnap.conf /app/etc/tarsnap.conf + +# Install tarsnapper +# renovate: datasource=pypi packageName=tarsnapper +ARG TARSNAPPER_VERSION="0.5.0" +RUN --mount=type=cache,target=/root/.cache/pip \ + python -m pip install tarsnapper==${TARSNAPPER_VERSION} + +USER appuser + +CMD [ "tarsnapper" ] |