127 lines
3.7 KiB
Docker

# _ _ ____ ____
# / \ _ __(_) __ _|___ \ | _ \ _ __ ___
# / _ \ | '__| |/ _` | __) | | |_) | '__/ _ \
# / ___ \| | | | (_| |/ __/ | __/| | | (_) |
# /_/ \_\_| |_|\__,_|_____| |_| |_| \___/
#
# https://github.com/P3TERX/Aria2-Pro-Docker
#
# Copyright (c) 2020-2021 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
# Using Debian Bullseye as a more stable base than EOL Alpine
FROM debian:bullseye-slim
# Install s6-overlay and build aria2 in a single layer to reduce image size
# renovate: datasource=github-releases depName=just-containers/s6-overlay
ARG S6_OVERLAY_VERSION=v3.1.6.2
RUN BUILD_DEPS=" \
build-essential \
autoconf \
automake \
autotools-dev \
libtool \
pkg-config \
git \
gettext \
autopoint \
gettext-base \
libssl-dev \
libssh2-1-dev \
libc-ares-dev \
libexpat1-dev \
libc-ares-dev \
vim \
libexpat1 \
zlib1g-dev \
libsqlite3-dev \
" && \
apt-get update && \
apt-get install -y --no-install-recommends \
jq \
findutils \
ca-certificates \
curl \
xz-utils \
dos2unix \
$BUILD_DEPS && \
curl -sSL https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz -o /tmp/s6-overlay-noarch.tar.xz && \
curl -sSL https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz -o /tmp/s6-overlay-x86_64.tar.xz && \
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && \
tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz && \
git clone https://github.com/aria2/aria2.git /tmp/aria2 && \
cd /tmp/aria2 && \
git checkout 8985d66e71f980e7d2765753800078f47761f1ba && \
sed -i "s/\"1\", 1, 16, 'x'));/\"1\", 1, 128, 'x'));/" src/OptionHandlerFactory.cc && \
autoreconf -i && \
./configure \
--disable-dependency-tracking \
--enable-static \
--disable-shared \
--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
--without-libxml2 \
--with-libexpat \
--without-libgcrypt \
--with-openssl \
--with-libcares \
--with-libsqlite3 \
--with-libssh2 \
--with-zlib && \
make -j$(nproc) && \
make install && \
cd / && \
# No purge runtime dev apt-get purge -y --auto-remove $BUILD_DEPS && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/*
COPY rootfs /
RUN find /etc/cont-init.d /etc/services.d -type f -exec dos2unix {} + && \
find /etc/cont-init.d /etc/services.d -type f -exec chmod +x {} +
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=1 \
RCLONE_CONFIG=/config/rclone.conf \
UPDATE_TRACKERS=true \
CUSTOM_TRACKER_URL= \
LISTEN_PORT=6888 \
RPC_PORT=6800 \
RPC_SECRET= \
PUID= PGID= \
DISK_CACHE= \
IPV6_MODE= \
UMASK_SET= \
SPECIAL_MODE=
EXPOSE \
6800 \
6888 \
6888/udp
VOLUME \
/config \
/downloads
#ENTRYPOINT ["/init"]
CMD ["aria2c", \
"--enable-rpc=true", \
"--rpc-listen-all=true", \
"--rpc-listen-port=6800", \
"--listen-port=6888", \
"--disable-ipv6=true", \
"--max-concurrent-downloads=128", \
"--max-connection-per-server=32", \
"--split=6", \
"--min-split-size=2M", \
"--file-allocation=falloc", \
"--continue=false", \
"--check-integrity=false", \
"--log-level=info", \
"--console-log-level=info", \
"--save-session-interval=5", \
"--dir=/downloads", \
"--disk-cache=64M", \
"--input-file=/config/aria2.session", \
"--save-session=/config/aria2.session"]