Skip to content

Instantly share code, notes, and snippets.

@thrnz
Created September 15, 2020 04:18
Show Gist options
  • Save thrnz/dcbaa0af66c70af8e302a1c7eb75484a to your computer and use it in GitHub Desktop.
Save thrnz/dcbaa0af66c70af8e302a1c7eb75484a to your computer and use it in GitHub Desktop.
Helper container to pass forwarded port to Deluge
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"]
#!/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
@n-insaidoo
Copy link

Thank you @andrewfraley this apk upgrade musl saved me!

@itavero
Copy link

itavero commented Dec 23, 2024

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