├── Dockerfile ├── README.md ├── LICENSE └── btsync.conf /Dockerfile: -------------------------------------------------------------------------------- 1 | # BitTorrent Sync 2 | # VERSION 0.2 3 | 4 | FROM ubuntu:14.04 5 | 6 | MAINTAINER Bill Thornton 7 | 8 | # Download and extract the executable to /usr/bin 9 | ADD http://download-new.utorrent.com/endpoint/btsync/os/linux-x64/track/stable /usr/bin/btsync.tar.gz 10 | RUN cd /usr/bin && tar -xzvf btsync.tar.gz && rm btsync.tar.gz 11 | 12 | # Web GUI 13 | EXPOSE 8888 14 | # Listening port 15 | EXPOSE 55555 16 | 17 | ENTRYPOINT ["btsync"] 18 | CMD ["--config", "/btsync/btsync.conf", "--nodaemon"] 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | BitTorrent Sync Dockerfile 2 | ========================== 3 | 4 | This will build a [docker](http://www.docker.io/) image that runs [BitTorrent Sync](http://labs.bittorrent.com/experiments/sync.html). 5 | 6 | 7 | ### Building the Image ### 8 | 9 | ``` 10 | docker build -t btsync . 11 | ``` 12 | 13 | 14 | ### Running BitTorrent Sync ### 15 | 16 | ``` 17 | docker run -d -p 8888:8888 -p 55555:55555 -v /srv/btsync/:/btsync/ btsync 18 | ``` 19 | 20 | `-d` run in detached mode 21 | 22 | `-p` expose container port `[public-port]:[container-port]` 23 | > btsync.conf sets the container ports 8888 as the web ui and 55555 as the listening port 24 | 25 | > If you do not explicitly set a public port, a random open port will be used because the ports are exposed in the Dockerfile 26 | 27 | `-v` mount a local directory in the container `[host-dir]:[container-dir]` 28 | > btsync.conf should be located in a directory mounted to the container directory `/btsync/` 29 | 30 | ### Tutorial ### 31 | More details are available in [this tutorial](http://blog.bittorrent.com/2013/10/22/sync-hacks-deploy-bittorrent-sync-with-docker/). 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Bill Thornton 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | Redistributions in binary form must reproduce the above copyright notice, this 11 | list of conditions and the following disclaimer in the documentation and/or 12 | other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /btsync.conf: -------------------------------------------------------------------------------- 1 | { 2 | "device_name": "My Sync Device", 3 | "listening_port" : 55555, // 0 - randomize port 4 | 5 | /* storage_path dir contains auxilliary app files 6 | if no storage_path field: .sync dir created in the directory 7 | where binary is located. 8 | otherwise user-defined directory will be used 9 | */ 10 | "storage_path" : "/btsync/.sync", 11 | 12 | // uncomment next line if you want to set location of pid file 13 | // "pid_file" : "/var/run/btsync/btsync.pid", 14 | 15 | "check_for_updates" : true, 16 | "use_upnp" : true, // use UPnP for port mapping 17 | 18 | 19 | /* limits in kB/s 20 | 0 - no limit 21 | */ 22 | "download_limit" : 0, 23 | "upload_limit" : 0, 24 | 25 | /* remove "listen" field to disable WebUI 26 | remove "login" and "password" fields to disable credentials check 27 | */ 28 | "webui" : 29 | { 30 | "listen" : "0.0.0.0:8888", 31 | "login" : "admin", 32 | "password" : "password" 33 | } 34 | 35 | /* !!! if you set shared folders in config file WebUI will be DISABLED !!! 36 | shared directories specified in config file 37 | override the folders previously added from WebUI. 38 | */ 39 | /* 40 | , 41 | "shared_folders" : 42 | [ 43 | { 44 | // use --generate-secret in command line to create new secret 45 | "secret" : "MY_SECRET_1", // * required field 46 | "dir" : "/home/user/bittorrent/sync_test", // * required field 47 | 48 | // use relay server when direct connection fails 49 | "use_relay_server" : true, 50 | "use_tracker" : true, 51 | "use_dht" : false, 52 | "search_lan" : true, 53 | // enable sync trash to store files deleted on remote devices 54 | "use_sync_trash" : true, 55 | // specify hosts to attempt connection without additional search 56 | "known_hosts" : 57 | [ 58 | "192.168.1.2:44444" 59 | ] 60 | } 61 | ] 62 | */ 63 | 64 | // Advanced preferences can be added to config file. 65 | // Info is available in BitTorrent Sync User Guide. 66 | 67 | } 68 | 69 | --------------------------------------------------------------------------------