1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-21 17:56:53 +02:00

update aria2

This commit is contained in:
kev 2022-08-08 17:56:44 +08:00
parent 88378fc6a3
commit 1cd5d434e5
5 changed files with 22 additions and 23 deletions

View File

@ -5,20 +5,18 @@
FROM alpine:3
MAINTAINER EasyPi Software Foundation
RUN set -xe \
&& apk add --no-cache aria2 \
&& aria2c https://github.com/tianon/gosu/releases/download/1.14/gosu-amd64 -o /usr/local/bin/gosu \
&& chmod +x /usr/local/bin/gosu \
&& adduser -D aria2
RUN apk add --no-cache aria2
COPY ./data/aria2.conf /etc/aria2/
VOLUME /data /etc/aria2
WORKDIR /data
EXPOSE 6800
COPY ./data/etc/aria2.conf /etc/aria2/
ENV DIR=/data
ENV PORT=6800
ENV TOKEN=00000000-0000-0000-0000-000000000000
CMD set -xe \
&& chown -R aria2:aria2 /data \
&& gosu aria2 aria2c --conf-path=/etc/aria2/aria2.conf \
--rpc-secret=${TOKEN}
WORKDIR $DIR
EXPOSE ${PORT}
CMD aria2c --conf-path=/etc/aria2/aria2.conf \
--rpc-listen-port=${PORT} \
--rpc-secret=${TOKEN} \
--dir=${DIR}

View File

@ -13,12 +13,13 @@ aria2
~/fig/aria2/
├── docker-compose.yml
└── data/
├── disk/ -> /mnt/usb/
├── default.conf
└── aria2.conf
├── var/ -> /mnt/usb/
└── etc/
├── default.conf
└── aria2.conf
```
> You may make `disk` a symbolic link to `/mnt/usb` or somewhere else.
> You may make `var` a symbolic link to `/mnt/usb` or somewhere else.
> To implement disk quota, you can even create a [virtual disk][5].
## docker-compose.yml
@ -33,10 +34,10 @@ services:
ports:
- "6800:6800"
volumes:
- ./data/aria2.conf:/etc/aria2/aria2.conf
- ./data/disk:/data
- ./data/etc:/etc/aria2/
- ./data/var:/data
environment:
- TOKEN=e6c3778f-6361-4ed0-b126-f2cf8fca06db
- TOKEN=0d5e0e73-96f7-4936-b125-e8f5f2296b08
restart: unless-stopped
webui:

View File

@ -7,10 +7,10 @@ services:
ports:
- "6800:6800"
volumes:
- ./data/aria2.conf:/etc/aria2/aria2.conf
- ./data/disk:/data
- ./data/etc:/etc/aria2/
- ./data/var:/data
environment:
- TOKEN=e6c3778f-6361-4ed0-b126-f2cf8fca06db
- TOKEN=0d5e0e73-96f7-4936-b125-e8f5f2296b08
restart: unless-stopped
webui: