docker-backuppc/Dockerfile

57 lines
2.6 KiB
Docker
Raw Permalink Normal View History

2018-09-12 10:15:35 +02:00
FROM alpine:3.8
LABEL maintainer="Adrien Ferrand <ferrand.ad@gmail.com>"
2018-11-26 23:34:04 +01:00
ENV BACKUPPC_VERSION 4.3.0
2018-11-27 10:10:14 +01:00
ENV BACKUPPC_XS_VERSION 0.57
ENV RSYNC_BPC_VERSION 3.0.9.12
ENV PAR2_VERSION v0.8.0
# Install backuppc runtime dependencies
RUN apk --no-cache --update add python3 rsync bash perl perl-archive-zip perl-xml-rss perl-cgi perl-file-listing expat samba-client iputils openssh openssl rrdtool msmtp lighttpd lighttpd-mod_auth gzip apache2-utils tzdata libstdc++ libgomp shadow \
2018-09-12 10:15:35 +02:00
# Install backuppc build dependencies
&& apk --no-cache --update --virtual build-dependencies add gcc g++ libgcc linux-headers autoconf automake make git patch perl-dev python3-dev expat-dev acl-dev attr-dev popt-dev curl wget \
2018-09-12 11:07:36 +02:00
# Install supervisor
&& python3 -m ensurepip \
2018-09-12 11:25:50 +02:00
&& pip3 install --upgrade pip circus \
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
# Compile and install PAR2
2018-09-12 10:15:35 +02:00
&& git clone https://github.com/Parchive/par2cmdline.git /root/par2cmdline --branch $PAR2_VERSION \
&& cd /root/par2cmdline && ./automake.sh && ./configure && make && make check && 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
2018-09-12 10:15:35 +02: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
&& 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
COPY files/lighttpd.conf /etc/lighttpd/lighttpd.conf
COPY files/entrypoint.sh /entrypoint.sh
COPY files/run.sh /run.sh
2018-09-12 11:25:50 +02:00
COPY files/circus.ini /etc/circus.ini
EXPOSE 8080
WORKDIR /home/backuppc
VOLUME ["/etc/backuppc", "/home/backuppc", "/data/backuppc"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/run.sh"]