├── .dockerignore ├── examples ├── docker-compose.yaml └── duplicati.service ├── LICENSE ├── Dockerfile ├── entrypoint.sh └── README.md /.dockerignore: -------------------------------------------------------------------------------- 1 | examples/ 2 | -------------------------------------------------------------------------------- /examples/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | services: 4 | 5 | duplicati: 6 | image: intersoftlab/duplicati:canary 7 | ports: 8 | - "127.0.0.1:8200:8200" 9 | restart: always 10 | cpu_shares: 512 11 | mem_limit: 256m 12 | environment: 13 | DUPLICATI_PASS: "123456" 14 | MONO_EXTERNAL_ENCODINGS: "UTF-8" 15 | volumes: 16 | - "duplicati-metadata:/root/.config/Duplicati" 17 | - "/:/data" 18 | tmpfs: 19 | - "/tmp" 20 | 21 | volumes: 22 | duplicati-metadata: 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Dmitry P. Karpov 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /examples/duplicati.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Duplicati service 3 | Requires=docker.service 4 | After=docker.service 5 | [Service] 6 | Environment="TARGET=/" 7 | Environment="PASSWORD=123456" 8 | Environment="BIND_HOST=127.0.0.1" 9 | Environment="BIND_PORT=8200" 10 | Environment="INSTANCE=duplicati" 11 | Environment="IMAGE=intersoftlab/duplicati:canary" 12 | Environment="METADATA_VOL=duplicati-metadata" 13 | Environment="MEMORY=256m" 14 | Environment="CPU_SHARES=512" 15 | # Pull docker image each time 16 | # ExecStartPre=-/usr/bin/docker pull ${IMAGE} 17 | ExecStartPre=-/bin/sh -c "docker rm -f ${INSTANCE} >/dev/null 2>&1" 18 | ExecStart=/bin/sh -c "docker run --rm -i --name ${INSTANCE} \ 19 | -m=${MEMORY} \ 20 | --cpu-shares=${CPU_SHARES} \ 21 | -p ${BIND_HOST}:${BIND_PORT}:8200 \ 22 | -v ${METADATA_VOL}:/root/.config/Duplicati \ 23 | -v ${TARGET}:/data \ 24 | -v /tmp \ 25 | -e DUPLICATI_PASS=${PASSWORD} \ 26 | -e MONO_EXTERNAL_ENCODINGS=UTF-8 \ 27 | ${IMAGE}" 28 | ExecStop=/bin/sh -c "docker stop ${INSTANCE}" 29 | TimeoutStartSec=0 30 | TimeoutStopSec=20s 31 | SuccessExitStatus=0 1 2 32 | [Install] 33 | WantedBy=multi-user.target 34 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mono:4.6 2 | MAINTAINER Dmitry K "d.p.karpov@gmail.com" 3 | 4 | ARG DUPLICATI_VER=2.0.3.9_canary_2018-06-30 5 | ENV DUPLICATI_VER ${DUPLICATI_VER} 6 | ARG DUPLICATI_BRANCH=canary 7 | ENV DUPLICATI_BRANCH ${DUPLICATI_BRANCH} 8 | 9 | ENV D_CODEPAGE UTF-8 10 | ENV D_LANG en_US 11 | 12 | ADD ./entrypoint.sh /entrypoint.sh 13 | 14 | RUN apt-get -o Acquire::ForceIPv4=true -o Acquire::http::No-Cache=True update && \ 15 | DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::ForceIPv4=true -o Acquire::http::No-Cache=True -o Dpkg::Options::=--force-confold install -y --no-install-recommends \ 16 | expect \ 17 | libsqlite3-0 \ 18 | unzip \ 19 | locales && \ 20 | curl -sSL https://updates.duplicati.com/${DUPLICATI_BRANCH}/duplicati-${DUPLICATI_VER}.zip -o /duplicati-${DUPLICATI_VER}.zip && \ 21 | unzip duplicati-${DUPLICATI_VER}.zip -d /app && \ 22 | rm /duplicati-${DUPLICATI_VER}.zip && \ 23 | localedef -v -c -i ${D_LANG} -f ${D_CODEPAGE} ${D_LANG}.${D_CODEPAGE} || : && \ 24 | update-locale LANG=${D_LANG}.${D_CODEPAGE} && \ 25 | cert-sync /etc/ssl/certs/ca-certificates.crt && \ 26 | apt-get purge -y --auto-remove unzip && \ 27 | apt-get clean && \ 28 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ 29 | chmod a+x /entrypoint.sh 30 | 31 | VOLUME /root/.config/Duplicati 32 | VOLUME /docker-entrypoint-init.d 33 | 34 | EXPOSE 8200 35 | 36 | ENTRYPOINT ["/entrypoint.sh"] 37 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DUPLICATI_CMD='mono /app/Duplicati.CommandLine.exe' 4 | DUPLICATI_DATADIR=/root/.config/Duplicati 5 | 6 | if [ ! -f "/.init_complete" ]; then 7 | echo 'Runing Duplicati Init scripts...' 8 | 9 | for f in /docker-entrypoint-init.d/*; do 10 | case "$f" in 11 | *.sh) echo "$0: running $f"; . "$f" ;; 12 | *) echo "$0: ignoring $f" ;; 13 | esac 14 | echo 15 | done 16 | touch /.init_complete 17 | fi 18 | 19 | if [ ! "$(ls -l ${DUPLICATI_DATADIR}/*.sqlite 2>/dev/null |wc -l)" -gt "0" ]; then 20 | echo 'Copying initial configs...' 21 | 22 | for f in /docker-entrypoint-init.d/*; do 23 | case "$f" in 24 | *.sqlite) echo "$0: copying $f"; cp "$f" ${DUPLICATI_DATADIR}/ ;; 25 | *) echo "$0: ignoring $f" ;; 26 | esac 27 | echo 28 | done 29 | fi 30 | 31 | if [ -z "$1" ]; then 32 | if [ ! -n "$DUPLICATI_PASS" ]; then 33 | echo "ERROR- DUPLICATI_PASS must be defined" 34 | exit 1 35 | fi 36 | exec mono /app/Duplicati.Server.exe --webservice-port=8200 --webservice-interface=* --webservice-password=${DUPLICATI_PASS} --webservice-sslcertificatefile=${DUPLICATI_CERT} --webservice-sslcertificatepassword=${DUPLICATI_CERT_PASS} 37 | else 38 | $DUPLICATI_CMD $@ 39 | if [ "$?" -eq 100 ] && [ -n "$ENABLE_AUTO_REPAIR" ]; then 40 | echo "Trying to repair local storage." 41 | $DUPLICATI_CMD $(echo $@ | sed "s/^\w*\s/repair /g" | sed -r 's/[* ]\/[a-zA-Z_].*+//') 42 | $DUPLICATI_CMD $@ 43 | fi 44 | fi 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![](https://images.microbadger.com/badges/image/intersoftlab/duplicati.svg)](https://microbadger.com/images/intersoftlab/duplicati "Get your own image badge on microbadger.com") 2 | 3 | # Supported tags and respective Dockerfile links # 4 | - `1.3.4` [(Dockerfile)](https://github.com/dmitryint/docker-duplicati/blob/duplicati_1.3.4/Dockerfile) 5 | - `1.3.4-dev` [(Dockerfile)](https://github.com/dmitryint/docker-duplicati/blob/duplicati_1.3.4-dev/Dockerfile) 6 | - `2.0` [(Dockerfile)](https://github.com/dmitryint/docker-duplicati/blob/duplicati_2.0/Dockerfile) 7 | 8 | - `canary`, `latest` [(Dockerfile)](https://github.com/dmitryint/docker-duplicati/blob/duplicati_canary/Dockerfile) 9 | 10 | # Duplicati # 11 | Duplicati is a backup client that securely stores encrypted, incremental, compressed backups on cloud storage services and remote file servers. It works with Amazon S3, Windows Live SkyDrive, Google Drive (Google Docs), Rackspace Cloud Files or WebDAV, SSH, FTP (and many more). Duplicati is open source and free. 12 | 13 | Duplicati has built-in AES-256 encryption and backups can be signed using GNU Privacy Guard. A built-in scheduler makes sure that backups are always up-to-date. Last but not least, Duplicati provides various options and tweaks like filters, deletion rules, transfer and bandwidth options to run backups for specific purposes. 14 | 15 | Duplicati is licensed under LGPL and available for Windows and Linux (.NET 2.0+ or Mono required). The Duplicati project was inspired by duplicity. Duplicati and duplicity are similar but not compatible. Duplicati is available in English, Spanish, French, German, Danish, Portugese, Italian, and Chinese. 16 | 17 | ### Duplicati Features ### 18 | * Duplicati uses AES-256 encryption (or GNU Privacy Guard) to secure all data before it is uploaded. 19 | * Duplicati uploads a full backup initially and stores smaller, incremental updates afterwards to save bandwidth and storage space. 20 | * A scheduler keeps backups up-to-date automatically. 21 | * Encrypted backup files are transferred to targets like FTP, Cloudfiles, WebDAV, SSH (SFTP), Amazon S3 and others. 22 | * Duplicati allows backups of folders, document types like e.g. documents or images, or custom filter rules. 23 | * Duplicati is available as application with an easy-to-use user interface and as command line tool. 24 | * Duplicati can make proper backups of opened or locked files using the Volume Snapshot Service (VSS) under Windows or the Logical Volume Manager (LVM) under Linux. This allows Duplicati to back up the Microsoft Outlook PST file while Outlook is running. 25 | 26 | ### Getting Help ### 27 | * [Oficial duplicati wiki](https://github.com/duplicati/duplicati/wiki) 28 | * Get command-line help 29 | ```bash 30 | docker run --rm -it \ 31 | -v /root/.config/Duplicati/:/root/.config/Duplicati/ \ 32 | -v /data:/data \ 33 | -e MONO_EXTERNAL_ENCODINGS=UTF-8 \ 34 | intersoftlab/duplicati:canary help 35 | ``` 36 | 37 | ### Start duplicati with web interface ### 38 | To start with the web interface, run the following command: 39 | ```bash 40 | docker run --rm -it \ 41 | -v /root/.config/Duplicati/:/root/.config/Duplicati/ \ 42 | -v /data:/data \ 43 | -e DUPLICATI_PASS=duplicatiPass \ 44 | -e MONO_EXTERNAL_ENCODINGS=UTF-8 \ 45 | -p 8200:8200 \ 46 | intersoftlab/duplicati:canary 47 | ``` 48 | 49 | Here you can see more [examples](examples). 50 | 51 | ### Initializing a fresh instance ### 52 | When a container is started for the first time, it will execute files with extensions .sh, .sqlite that are found in `/docker-entrypoint-init.d`. Files will be executed in alphabetical order. 53 | You can easily populate your Duplicati configuration by mounting configuration files into that directory. 54 | 55 | ### Known errors ### 56 | 57 | - **Error massage:** `The authorization header is malformed; the Credential is mal-formed; expecting "/YYYYMMDD/REGION/SERVICE/aws4_request".` 58 | 59 | **Discussion there:** https://github.com/duplicati/duplicati/issues/2603 60 | 61 | **Workaround:** start Docker container with the following option: `-v /etc/localtime:/etc/localtime:ro` 62 | --------------------------------------------------------------------------------