├── Dockerfile └── start-btsync /Dockerfile: -------------------------------------------------------------------------------- 1 | # Instructions from the blog post at http://blog.bittorrent.com/2013/10/22/sync-hacks-deploy-bittorrent-sync-with-docker/ 2 | FROM ubuntu:14.04 3 | MAINTAINER Lucas Carlson 4 | RUN apt-get update && apt-get install -y curl 5 | RUN curl -o /usr/bin/btsync.tar.gz http://download-lb.utorrent.com/endpoint/btsync/os/linux-x64/track/stable 6 | RUN cd /usr/bin && tar -xzvf btsync.tar.gz && rm btsync.tar.gz 7 | RUN mkdir -p /btsync/.sync 8 | RUN mkdir -p /var/run/btsync 9 | RUN mkdir -p /data 10 | EXPOSE 8888 11 | EXPOSE 55555 12 | ADD start-btsync /usr/bin/start-btsync 13 | RUN chmod +x /usr/bin/start-btsync 14 | VOLUME ["/data"] 15 | ENTRYPOINT ["start-btsync"] 16 | -------------------------------------------------------------------------------- /start-btsync: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SECRET="${@}" 3 | : ${SECRET:=`btsync --generate-secret`} 4 | 5 | echo "Starting btsync with secret: $SECRET" 6 | 7 | echo "{ 8 | \"device_name\": \"Sync Server\", 9 | \"listening_port\": 55555, 10 | \"storage_path\": \"/btsync/.sync\", 11 | \"pid_file\": \"/var/run/btsync/btsync.pid\", 12 | \"check_for_updates\": false, 13 | \"use_upnp\": false, 14 | \"download_limit\": 0, 15 | \"upload_limit\": 0, 16 | \"shared_folders\": [ 17 | { 18 | \"secret\": \"$SECRET\", 19 | \"dir\": \"/data\", 20 | \"use_relay_server\": true, 21 | \"use_tracker\": true, 22 | \"use_dht\": false, 23 | \"search_lan\": true, 24 | \"use_sync_trash\": false 25 | } 26 | ] 27 | }" > /btsync/btsync.conf 28 | 29 | btsync --config /btsync/btsync.conf --nodaemon 30 | --------------------------------------------------------------------------------