mirror of
https://github.com/newnius/Dockerfiles.git
synced 2025-06-06 08:11:54 +00:00
add aria2
This commit is contained in:
parent
7f947af49e
commit
3c1105d8b4
18
aria2/Dockerfile
Normal file
18
aria2/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
||||
FROM alpine:3.8
|
||||
|
||||
MAINTAINER Newnius <newnius.cn@gmail.com>
|
||||
|
||||
USER root
|
||||
|
||||
# Prerequisites
|
||||
RUN apk add --no-cache aria2
|
||||
|
||||
RUN mkdir -p /etc/aria2/
|
||||
|
||||
ADD aria2.conf /etc/aria2/aria2.conf
|
||||
|
||||
ADD bootstrap.sh /etc/bootstrap.sh
|
||||
|
||||
WORKDIR /
|
||||
|
||||
CMD ["/etc/bootstrap.sh"]
|
43
aria2/aria2.conf
Normal file
43
aria2/aria2.conf
Normal file
@ -0,0 +1,43 @@
|
||||
dir=/downloads
|
||||
|
||||
file-allocation=none
|
||||
|
||||
continue=true
|
||||
|
||||
max-concurrent-downloads=5
|
||||
|
||||
max-connection-per-server=5
|
||||
|
||||
min-split-size=10M
|
||||
|
||||
split=5
|
||||
|
||||
disable-ipv6=true
|
||||
|
||||
## RPC ##
|
||||
enable-rpc=true
|
||||
|
||||
rpc-allow-origin-all=true
|
||||
|
||||
rpc-listen-all=true
|
||||
|
||||
#event-poll=select
|
||||
|
||||
rpc-listen-port=6800
|
||||
|
||||
rpc-secret=123456
|
||||
|
||||
## BT/PT ##
|
||||
|
||||
enable-dht=true
|
||||
|
||||
enable-peer-exchange=true
|
||||
|
||||
peer-id-prefix=-TR2770-
|
||||
user-agent=Transmission/2.77
|
||||
|
||||
seed-ratio=1
|
||||
|
||||
bt-seed-unverified=true
|
||||
|
||||
bt-save-metadata=true
|
8
aria2/bootstrap.sh
Executable file
8
aria2/bootstrap.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! [[ -z "${RPC_SECRET}" ]]; then
|
||||
sed -i '/rpc-secret=/d' /etc/aria2/aria2.conf
|
||||
echo -e "\nrpc_secret==$RPC_SECRET" >> /etc/aria2/aria2.conf
|
||||
fi
|
||||
|
||||
aria2c --conf-path=/etc/aria2/aria2.conf
|
Loading…
Reference in New Issue
Block a user