Initial commit
ContainerImages/restic-exporter/pipeline/head This commit looks good
Details
ContainerImages/restic-exporter/pipeline/head This commit looks good
Details
Although there is a *docker.io/ngosang/restic-exporter* image, for simple tools like this, I prefer to maintain container images myself. This ensures that the images will continue to receive operating system updates, even if the upstream project stagnates.main
commit
26a4b16223
|
@ -0,0 +1,49 @@
|
|||
FROM git.pyrocufflink.net/containerimages/dch-base AS build
|
||||
|
||||
RUN --mount=type=cache,target=/var/cache \
|
||||
microdnf install -y \
|
||||
--setopt=install_weak_deps=0 \
|
||||
git-core \
|
||||
python3-pip \
|
||||
python3-wheel \
|
||||
&& :
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
ARG RESTIC_EXPORTER_VERSION=1.5.0
|
||||
|
||||
RUN git clone \
|
||||
https://github.com/ngosang/restic-exporter.git \
|
||||
--depth 1 \
|
||||
-b ${RESTIC_EXPORTER_VERSION} \
|
||||
&& :
|
||||
|
||||
WORKDIR /build/restic-exporter
|
||||
|
||||
RUN python3 -m pip wheel -w ../wheels -r requirements.txt
|
||||
|
||||
|
||||
FROM git.pyrocufflink.net/containerimages/dch-base
|
||||
|
||||
RUN --mount=type=cache,target=/var/cache \
|
||||
microdnf install -y \
|
||||
--setopt=install_weak_deps=0 \
|
||||
python3 \
|
||||
restic \
|
||||
tini \
|
||||
&& :
|
||||
|
||||
RUN --mount=type=bind,from=build,src=/build,target=/build \
|
||||
python3 -m venv /app \
|
||||
&& pythonpath=$(/app/bin/python -Esc 'from sysconfig import *;print(get_path("purelib"))') \
|
||||
&& /app/bin/python -m pip install \
|
||||
--find-links /build/wheels \
|
||||
--no-index \
|
||||
--requirement /build/restic-exporter/requirements.txt \
|
||||
&& cp /build/restic-exporter/restic-exporter.py \
|
||||
"${pythonpath}"/restic_exporter.py \
|
||||
&& :
|
||||
|
||||
USER 8001:8001
|
||||
|
||||
ENTRYPOINT ["tini", "/app/bin/python", "--", "-m", "restic_exporter"]
|
|
@ -0,0 +1 @@
|
|||
buildContainerImage2()
|
Loading…
Reference in New Issue