2023-10-12 05:29:23 +00:00
|
|
|
FROM docker.io/library/python:3.11 AS build
|
|
|
|
|
|
|
|
RUN apt update --yes
|
|
|
|
RUN apt install --yes \
|
|
|
|
libacl1-dev \
|
|
|
|
libacl1 \
|
|
|
|
libssl-dev \
|
|
|
|
liblz4-dev \
|
|
|
|
libzstd-dev \
|
|
|
|
libxxhash-dev \
|
|
|
|
build-essential \
|
|
|
|
pkg-config \
|
|
|
|
python3-pkgconfig \
|
|
|
|
libfuse3-dev
|
|
|
|
|
|
|
|
RUN python -m pip install \
|
|
|
|
Cython==3.0.3 \
|
|
|
|
pkgconfig==1.5.5 \
|
|
|
|
--disable-pip-version-check \
|
|
|
|
--upgrade
|
|
|
|
|
|
|
|
# remember to add borg user to fuse group in final container
|
|
|
|
|
|
|
|
COPY . /source
|
|
|
|
|
|
|
|
RUN cd /source/borgbackup && python -m pip wheel .[pyfuse3] \
|
|
|
|
--wheel-dir /wheels \
|
|
|
|
--prefer-binary \
|
|
|
|
--disable-pip-version-check
|
|
|
|
|
|
|
|
|
|
|
|
FROM docker.io/library/python:3.11-slim AS final
|
|
|
|
|
2023-10-15 21:19:29 +00:00
|
|
|
RUN apt update --yes && \
|
|
|
|
apt install openssh-clients --yes && \
|
|
|
|
apt clean all && \
|
|
|
|
mkdir /repo /data && \
|
|
|
|
useradd borg --uid 1000 --gid 1000 && \
|
|
|
|
chown --recursive borg:borg /repo
|
|
|
|
|
|
|
|
VOLUME ["/repo", "/data"]
|
2023-10-12 05:29:23 +00:00
|
|
|
|
2023-10-15 21:19:29 +00:00
|
|
|
COPY --from=build /wheels /wheels
|
2023-10-12 05:29:23 +00:00
|
|
|
RUN python -m pip install borgbackup[pyfuse3] \
|
|
|
|
--upgrade \
|
|
|
|
--pre \
|
|
|
|
--no-index \
|
|
|
|
--no-cache-dir \
|
|
|
|
--find-links /wheels \
|
|
|
|
--disable-pip-version-check && \
|
|
|
|
rm -rf /install/
|
|
|
|
|
2023-10-15 21:19:29 +00:00
|
|
|
USER 1000:1000
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/borg"]
|