|
|
@@ -1,29 +1,43 @@
|
|
|
-FROM docker.snppla.net/snppla/openvpn:1.0
|
|
|
+ARG BASE_IMAGE=docker.snppla.net/snppla/openvpn:1.0
|
|
|
+
|
|
|
+# Build the WebAPI plugin against the same Python 3 the runtime image uses
|
|
|
+FROM ${BASE_IMAGE} AS webapi-build
|
|
|
+
|
|
|
+ARG DEBIAN_FRONTEND=noninteractive
|
|
|
+# Current master; v0.2.1 predates the Deluge 2 fixes
|
|
|
+ARG WEBAPI_REF=114c39324c1297168ffafd0ee9b2b2726c65408c
|
|
|
+
|
|
|
+RUN apt-get update && \
|
|
|
+ apt-get install -y --no-install-recommends \
|
|
|
+ ca-certificates \
|
|
|
+ git \
|
|
|
+ python3-setuptools && \
|
|
|
+ rm -rf /var/lib/apt/lists/*
|
|
|
+
|
|
|
+RUN git clone https://github.com/idlesign/deluge-webapi.git /src && \
|
|
|
+ git -C /src checkout ${WEBAPI_REF} && \
|
|
|
+ cd /src && \
|
|
|
+ rm -rf dist && \
|
|
|
+ python3 setup.py bdist_egg
|
|
|
+
|
|
|
+FROM ${BASE_IMAGE}
|
|
|
+
|
|
|
+ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
EXPOSE 58846
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
- apt-get install -y \
|
|
|
- software-properties-common \
|
|
|
- python3-pip \
|
|
|
- python3-setuptools \
|
|
|
- git && \
|
|
|
+ apt-get install -y --no-install-recommends software-properties-common gpg-agent && \
|
|
|
add-apt-repository ppa:deluge-team/stable -y && \
|
|
|
apt-get update && \
|
|
|
apt-get install -y --no-install-recommends deluged && \
|
|
|
+ apt-get purge -y --auto-remove software-properties-common gpg-agent && \
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
-# Build and install the WebAPI plugin against the container's Python 3
|
|
|
-RUN git clone https://github.com/idlesign/deluge-webapi.git /tmp/deluge-webapi && \
|
|
|
- cd /tmp/deluge-webapi && \
|
|
|
- python3 setup.py bdist_egg && \
|
|
|
- mkdir -p /config/plugins && \
|
|
|
- cp dist/WebAPI-*.egg /config/plugins/ && \
|
|
|
- rm -rf /tmp/deluge-webapi
|
|
|
+COPY --from=webapi-build /src/dist/WebAPI-*.egg /config/plugins/
|
|
|
|
|
|
RUN useradd -ms /bin/bash deluge
|
|
|
|
|
|
COPY deluged_init.sh /sbin/deluged_init.sh
|
|
|
-RUN chmod +x /sbin/deluged_init.sh
|
|
|
|
|
|
-CMD ["/sbin/deluged_init.sh"]
|
|
|
+CMD ["/sbin/deluged_init.sh"]
|