diff --git a/Dockerfile.armhf b/Dockerfile.armhf new file mode 100644 index 0000000000..c6d7724fa2 --- /dev/null +++ b/Dockerfile.armhf @@ -0,0 +1,103 @@ +# Transmission and OpenVPN +# +# Version 1.10 + +FROM resin/rpi-raspbian:jessie +MAINTAINER Kristian Haugene + +VOLUME /data +VOLUME /config + +# Update packages and install software +RUN apt-get update \ + && apt-get install -y transmission-cli transmission-common transmission-daemon \ + && apt-get install -y openvpn curl \ + && curl -sLO https://archive.raspbian.org/raspbian/pool/main/d/dumb-init/dumb-init_1.0.3-1_armhf.deb \ + && dpkg -i dumb-init_*.deb \ + && rm -rf dumb-init_*.deb \ + && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && curl -L https://github.com/jwilder/dockerize/releases/download/v0.2.0/dockerize-linux-armhf-v0.2.0.tar.gz | tar -C /usr/local/bin -xzv + +# Add configuration and scripts +ADD openvpn/ /etc/openvpn/ +ADD transmission/ /etc/transmission/ + +ENV OPENVPN_USERNAME=**None** \ + OPENVPN_PASSWORD=**None** \ + OPENVPN_PROVIDER=**None** \ + "TRANSMISSION_ALT_SPEED_DOWN=50" \ + "TRANSMISSION_ALT_SPEED_ENABLED=false" \ + "TRANSMISSION_ALT_SPEED_TIME_BEGIN=540" \ + "TRANSMISSION_ALT_SPEED_TIME_DAY=127" \ + "TRANSMISSION_ALT_SPEED_TIME_ENABLED=false" \ + "TRANSMISSION_ALT_SPEED_TIME_END=1020" \ + "TRANSMISSION_ALT_SPEED_UP=50" \ + "TRANSMISSION_BIND_ADDRESS_IPV4=0.0.0.0" \ + "TRANSMISSION_BIND_ADDRESS_IPV6=::" \ + "TRANSMISSION_BLOCKLIST_ENABLED=false" \ + "TRANSMISSION_BLOCKLIST_URL=http://www.example.com/blocklist" \ + "TRANSMISSION_CACHE_SIZE_MB=4" \ + "TRANSMISSION_DHT_ENABLED=true" \ + "TRANSMISSION_DOWNLOAD_DIR=/data/completed" \ + "TRANSMISSION_DOWNLOAD_LIMIT=100" \ + "TRANSMISSION_DOWNLOAD_LIMIT_ENABLED=0" \ + "TRANSMISSION_DOWNLOAD_QUEUE_ENABLED=true" \ + "TRANSMISSION_DOWNLOAD_QUEUE_SIZE=5" \ + "TRANSMISSION_ENCRYPTION=1" \ + "TRANSMISSION_IDLE_SEEDING_LIMIT=30" \ + "TRANSMISSION_IDLE_SEEDING_LIMIT_ENABLED=false" \ + "TRANSMISSION_INCOMPLETE_DIR=/data/incomplete" \ + "TRANSMISSION_INCOMPLETE_DIR_ENABLED=true" \ + "TRANSMISSION_LPD_ENABLED=false" \ + "TRANSMISSION_MAX_PEERS_GLOBAL=200" \ + "TRANSMISSION_MESSAGE_LEVEL=2" \ + "TRANSMISSION_PEER_CONGESTION_ALGORITHM=" \ + "TRANSMISSION_PEER_ID_TTL_HOURS=6" \ + "TRANSMISSION_PEER_LIMIT_GLOBAL=200" \ + "TRANSMISSION_PEER_LIMIT_PER_TORRENT=50" \ + "TRANSMISSION_PEER_PORT=51413" \ + "TRANSMISSION_PEER_PORT_RANDOM_HIGH=65535" \ + "TRANSMISSION_PEER_PORT_RANDOM_LOW=49152" \ + "TRANSMISSION_PEER_PORT_RANDOM_ON_START=false" \ + "TRANSMISSION_PEER_SOCKET_TOS=default" \ + "TRANSMISSION_PEX_ENABLED=true" \ + "TRANSMISSION_PORT_FORWARDING_ENABLED=false" \ + "TRANSMISSION_PREALLOCATION=1" \ + "TRANSMISSION_PREFETCH_ENABLED=1" \ + "TRANSMISSION_QUEUE_STALLED_ENABLED=true" \ + "TRANSMISSION_QUEUE_STALLED_MINUTES=30" \ + "TRANSMISSION_RATIO_LIMIT=2" \ + "TRANSMISSION_RATIO_LIMIT_ENABLED=false" \ + "TRANSMISSION_RENAME_PARTIAL_FILES=true" \ + "TRANSMISSION_RPC_AUTHENTICATION_REQUIRED=false" \ + "TRANSMISSION_RPC_BIND_ADDRESS=0.0.0.0" \ + "TRANSMISSION_RPC_ENABLED=true" \ + "TRANSMISSION_RPC_PASSWORD=password" \ + "TRANSMISSION_RPC_PORT=9091" \ + "TRANSMISSION_RPC_URL=/transmission/" \ + "TRANSMISSION_RPC_USERNAME=username" \ + "TRANSMISSION_RPC_WHITELIST=127.0.0.1" \ + "TRANSMISSION_RPC_WHITELIST_ENABLED=false" \ + "TRANSMISSION_SCRAPE_PAUSED_TORRENTS_ENABLED=true" \ + "TRANSMISSION_SCRIPT_TORRENT_DONE_ENABLED=false" \ + "TRANSMISSION_SCRIPT_TORRENT_DONE_FILENAME=" \ + "TRANSMISSION_SEED_QUEUE_ENABLED=false" \ + "TRANSMISSION_SEED_QUEUE_SIZE=10" \ + "TRANSMISSION_SPEED_LIMIT_DOWN=100" \ + "TRANSMISSION_SPEED_LIMIT_DOWN_ENABLED=false" \ + "TRANSMISSION_SPEED_LIMIT_UP=100" \ + "TRANSMISSION_SPEED_LIMIT_UP_ENABLED=false" \ + "TRANSMISSION_START_ADDED_TORRENTS=true" \ + "TRANSMISSION_TRASH_ORIGINAL_TORRENT_FILES=false" \ + "TRANSMISSION_UMASK=2" \ + "TRANSMISSION_UPLOAD_LIMIT=100" \ + "TRANSMISSION_UPLOAD_LIMIT_ENABLED=0" \ + "TRANSMISSION_UPLOAD_SLOTS_PER_TORRENT=14" \ + "TRANSMISSION_UTP_ENABLED=true" \ + "TRANSMISSION_WATCH_DIR=/data/watch" \ + "TRANSMISSION_WATCH_DIR_ENABLED=true" \ + "TRANSMISSION_HOME=/data/transmission-home" + +# Expose port and run +EXPOSE 9091 +CMD ["dumb-init", "/etc/openvpn/start.sh"] diff --git a/README.md b/README.md index 257c38be3d..495d87a41e 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,13 @@ If you have transmission authentication enabled and want scripts in another cont control the transmission-daemon, this can be a handy way to access the credentials. For example, another container may pause or restrict transmission speeds while the server is streaming video. +## Running on ARM (Raspberry PI) +Since the Raspberry PI runs on an ARM architecture instead of x64, the existing x64 images will not +work properly. To support users that wish to run this container on a Raspberry Pi, there are 2 additional +Dockerfiles created. The Dockerfiles supported by the Raspberry PI are Dockerfile.armhf -- there is +also an example docker-compose-armhf file that shows how you might use Transmission/OpenVPN and the +corresponding nginx reverse proxy on an RPI machine. + ## Make it work on Synology NAS Here are the steps to run it on a Synology NAS (Tested on DSM 6) : diff --git a/docker-compose-armhf.yml b/docker-compose-armhf.yml new file mode 100644 index 0000000000..c22b847b02 --- /dev/null +++ b/docker-compose-armhf.yml @@ -0,0 +1,29 @@ +transmission: + build: + context: . + dockerfile: Dockerfile.armhf + privileged: true + restart: always + ports: + - 9091:9091 + dns: + - 8.8.8.8 + - 8.8.4.4 + volumes: + - /etc/localtime:/etc/localtime:ro + - /your/storage/path/:/data + environment: + OPENVPN_PROVIDER: PIA + OPENVPN_USERNAME: username + OPENVPN_PASSWORD: password + OPENVPN_OPTS: "--inactive 3600 --ping 10 --ping-exit 60" + LOCAL_NETWORK: 192.168.0.0/24 + +proxy: + build: ./proxy/Dockerfile.armhf + links: + - transmission + ports: + - 8080:8080 + volumes: + - /etc/localtime:/etc/localtime:ro diff --git a/proxy/Dockerfile.armhf b/proxy/Dockerfile.armhf new file mode 100644 index 0000000000..b82813a663 --- /dev/null +++ b/proxy/Dockerfile.armhf @@ -0,0 +1,17 @@ +FROM resin/rpi-raspbian:jessie + +RUN apt-get update \ + && apt-get install -y \ + ca-certificates \ + nginx \ + && rm -rf /var/lib/apt/lists/* + +RUN ln -sf /dev/stdout /var/log/nginx/access.log \ + && ln -sf /dev/stderr /var/log/nginx/error.log + +EXPOSE 8080 + +COPY nginx.conf /etc/nginx/nginx.conf + +CMD ["nginx", "-g", "daemon off;"] +