2021-12-23 11:13:09 +01:00
|
|
|
FROM alpine:3.15.0
|
2017-04-22 14:08:24 +02:00
|
|
|
|
2017-10-01 23:22:06 +02:00
|
|
|
LABEL maintainer="Adrien Ferrand <ferrand.ad@gmail.com>"
|
2017-04-22 14:08:24 +02:00
|
|
|
|
2021-10-11 07:52:19 +02:00
|
|
|
ARG BACKUPPC_VERSION="4.4.0"
|
|
|
|
ARG BACKUPPC_XS_VERSION="0.62"
|
|
|
|
ARG RSYNC_BPC_VERSION="3.1.3.0"
|
|
|
|
|
|
|
|
ENV BACKUPPC_VERSION="${BACKUPPC_VERSION}"
|
|
|
|
ENV BACKUPPC_XS_VERSION="${BACKUPPC_XS_VERSION}"
|
|
|
|
ENV RSYNC_BPC_VERSION="${RSYNC_BPC_VERSION}"
|
2017-04-22 14:08:24 +02:00
|
|
|
|
2018-09-12 14:37:59 +02:00
|
|
|
# Install backuppc runtime dependencies
|
2020-03-01 16:14:57 +01:00
|
|
|
RUN apk --no-cache --update add \
|
2020-03-01 16:31:30 +01:00
|
|
|
rsync tar bash shadow ca-certificates \
|
2020-03-01 16:14:57 +01:00
|
|
|
supervisor \
|
2020-06-21 14:22:20 +02:00
|
|
|
perl perl-archive-zip perl-xml-rss perl-cgi perl-file-listing perl-json-xs \
|
2020-03-01 16:14:57 +01:00
|
|
|
expat samba-client iputils openssh openssl rrdtool ttf-dejavu \
|
2021-12-23 10:41:21 +01:00
|
|
|
msmtp lighttpd lighttpd-mod_auth apache2-utils tzdata libstdc++ libgomp \
|
|
|
|
gzip pigz \
|
2021-05-20 22:31:09 +02:00
|
|
|
&& apk --no-cache --update -X http://dl-cdn.alpinelinux.org/alpine/edge/community add par2cmdline \
|
2018-09-12 10:15:35 +02:00
|
|
|
# Install backuppc build dependencies
|
2020-03-01 16:14:57 +01:00
|
|
|
&& apk --no-cache --update --virtual build-dependencies add \
|
|
|
|
gcc g++ autoconf automake make git perl-dev acl-dev curl \
|
2018-09-12 11:07:36 +02:00
|
|
|
# Compile and install BackupPC:XS
|
2018-09-12 10:15:35 +02:00
|
|
|
&& git clone https://github.com/backuppc/backuppc-xs.git /root/backuppc-xs --branch $BACKUPPC_XS_VERSION \
|
|
|
|
&& cd /root/backuppc-xs \
|
|
|
|
&& perl Makefile.PL && make && make test && make install \
|
2018-09-12 11:07:36 +02:00
|
|
|
# Compile and install Rsync (BPC version)
|
2018-09-12 10:15:35 +02:00
|
|
|
&& git clone https://github.com/backuppc/rsync-bpc.git /root/rsync-bpc --branch $RSYNC_BPC_VERSION \
|
|
|
|
&& cd /root/rsync-bpc && ./configure && make reconfigure && make && make install \
|
2018-09-12 11:07:36 +02:00
|
|
|
# Configure MSMTP for mail delivery (initially sendmail is a sym link to busybox)
|
2018-09-12 10:15:35 +02:00
|
|
|
&& rm -f /usr/sbin/sendmail \
|
|
|
|
&& ln -s /usr/bin/msmtp /usr/sbin/sendmail \
|
2018-09-12 11:07:36 +02:00
|
|
|
# Disable strict host key checking
|
2018-09-12 10:15:35 +02:00
|
|
|
&& sed -i -e 's/^# Host \*/Host */g' /etc/ssh/ssh_config \
|
|
|
|
&& sed -i -e 's/^# StrictHostKeyChecking ask/ StrictHostKeyChecking no/g' /etc/ssh/ssh_config \
|
2018-09-12 11:07:36 +02:00
|
|
|
# Get BackupPC, it will be installed at runtime to allow dynamic upgrade of existing config/pool
|
2021-12-23 11:13:09 +01:00
|
|
|
&& curl -o /root/BackupPC-$BACKUPPC_VERSION.tar.gz -L https://github.com/backuppc/backuppc/releases/download/$BACKUPPC_VERSION/BackupPC-$BACKUPPC_VERSION.tar.gz \
|
2018-09-12 11:07:36 +02:00
|
|
|
# Prepare backuppc home
|
2018-09-12 14:37:59 +02:00
|
|
|
&& mkdir -p /home/backuppc && cd /home/backuppc \
|
|
|
|
# Mark the docker as not run yet, to allow entrypoint to do its stuff
|
2018-09-12 10:15:35 +02:00
|
|
|
&& touch /firstrun \
|
2018-09-12 11:07:36 +02:00
|
|
|
# Clean
|
2018-09-12 10:15:35 +02:00
|
|
|
&& rm -rf /root/backuppc-xs /root/rsync-bpc /root/par2cmdline \
|
|
|
|
&& apk del build-dependencies
|
2017-04-22 14:08:24 +02:00
|
|
|
|
|
|
|
COPY files/lighttpd.conf /etc/lighttpd/lighttpd.conf
|
2020-04-12 13:15:31 +02:00
|
|
|
COPY files/auth.conf /etc/lighttpd/auth.conf
|
|
|
|
COPY files/auth-ldap.conf /etc/lighttpd/auth-ldap.conf
|
2017-04-22 14:08:24 +02:00
|
|
|
COPY files/entrypoint.sh /entrypoint.sh
|
2020-03-01 15:57:35 +01:00
|
|
|
COPY files/supervisord.conf /etc/supervisord.conf
|
2017-04-22 14:08:24 +02:00
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
2018-09-12 14:37:59 +02:00
|
|
|
WORKDIR /home/backuppc
|
|
|
|
|
2017-04-22 14:08:24 +02:00
|
|
|
VOLUME ["/etc/backuppc", "/home/backuppc", "/data/backuppc"]
|
|
|
|
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
|
2020-03-01 16:14:57 +01:00
|
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
|