Created
September 15, 2020 04:18
-
-
Save thrnz/dcbaa0af66c70af8e302a1c7eb75484a to your computer and use it in GitHub Desktop.
Helper container to pass forwarded port to Deluge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:latest | |
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \ | |
echo "http://dl-cdn.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repositories && \ | |
echo "http://dl-cdn.alpinelinux.org/alpine/edge/main/" >> /etc/apk/repositories && \ | |
apk add --no-cache bash deluge | |
ADD pia-port.sh /scripts/pia-port.sh | |
RUN chmod +x /scripts/*.sh | |
CMD ["/scripts/pia-port.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
trap 'exit 0' SIGTERM | |
OLDPORT=0 | |
PORT=0 | |
while true | |
do | |
[ -r "/pia-shared/port.dat" ] && PORT=$(cat /pia-shared/port.dat) | |
if [ $OLDPORT -ne $PORT ]; then | |
echo "Setting Deluge port settings ($PORT)..." | |
deluge-console --config=/deluge/conf "config --set listen_ports ($PORT,$PORT)" | |
OLDPORT=$PORT | |
fi | |
sleep 30 & | |
wait $! | |
done |
Some recent change in Alpine started causing these errors coming from the deluge binary:
Error relocating /usr/lib/libpython3.12.so.1.0: pwritev2: symbol not found
Error relocating /usr/lib/libpython3.12.so.1.0: preadv2: symbol not found
The solution is to upgrade the musl
package when building the container, so your Dockerfile would then look like:
FROM alpine:latest
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/edge/main/" >> /etc/apk/repositories && \
apk add --no-cache bash deluge && \
apk upgrade musl
ADD pia-port.sh /scripts/pia-port.sh
RUN chmod +x /scripts/*.sh
CMD ["/scripts/pia-port.sh"]
Thank you @andrewfraley this apk upgrade musl
saved me!
Did someone already publish this to ghcr.io
or Docker Hub?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a version that works with an external Deluge instance and authenticates with a username and password.
In your docker-compose.yml
pia-port.sh
If you need to add a user to deluge, add to ~/.config/deluge/auth and restart deluged
user:pass:10