-
-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathDockerfile.runtime-base
More file actions
78 lines (68 loc) · 2.15 KB
/
Dockerfile.runtime-base
File metadata and controls
78 lines (68 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Internal Borg runtime base image used by CI.
# Keep this image private on Docker Hub and build it separately so app releases
# do not recompile Borg for every tag.
FROM python:3.10-slim AS runtime-base
ARG BORG1_VERSION=1.4.4
ARG BORG2_VERSION=2.0.0b21
ENV BORG1_VERSION=${BORG1_VERSION}
ENV BORG2_VERSION=${BORG2_VERSION}
LABEL org.opencontainers.image.title="Borg UI Runtime Base"
LABEL org.opencontainers.image.description="Shared runtime base for Borg UI with Borg 1.x and Borg 2.x preinstalled"
LABEL org.opencontainers.image.vendor="Borg UI"
LABEL org.opencontainers.image.source="https://github.com/karanhudia/borg-ui"
WORKDIR /app
RUN apt-get update && apt-get install -y \
cron \
curl \
wget \
gnupg \
lsb-release \
gosu \
sudo \
libacl1-dev \
libssl-dev \
liblz4-dev \
libzstd-dev \
libxxhash-dev \
build-essential \
pkg-config \
fuse3 \
libfuse3-dev \
rsync \
openssh-client \
sshfs \
python3-pip \
python3-dev \
htop \
iotop \
net-tools \
iputils-ping \
tree \
ncdu \
sshpass \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir pyfuse3
RUN pip install --no-cache-dir "borgbackup[fuse]==${BORG1_VERSION}"
RUN python3 -m venv /opt/borg2-venv && \
/opt/borg2-venv/bin/pip install --no-cache-dir pyfuse3 "borgbackup[fuse]==${BORG2_VERSION}" && \
ln -sf /opt/borg2-venv/bin/borg /usr/local/bin/borg2
RUN mkdir -p \
/data \
/data/ssh_keys \
/data/borg_keys \
/data/logs \
/data/config \
/backups \
/var/log/borg \
/etc/borg
RUN groupadd -g 1001 borg && \
useradd -m -u 1001 -g 1001 -s /bin/bash borg && \
usermod -a -G sudo borg && \
groupadd -f fuse && \
usermod -a -G fuse borg && \
echo "borg ALL=(ALL) NOPASSWD: /usr/bin/borg, /usr/bin/crontab, /usr/bin/apt-get" >> /etc/sudoers && \
sed -i 's/^#user_allow_other/user_allow_other/' /etc/fuse.conf
RUN mkdir -p /home/borg/.ssh /etc/cron.d && \
chown -R borg:borg /app /data /backups /var/log/borg /etc/borg /home/borg/.ssh /etc/cron.d && \
chmod -R 755 /app /data /backups /var/log/borg /etc/borg && \
chmod 700 /home/borg/.ssh