You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Running in docker doesnt allow to reload tor for ip change #5
FROM python:3.14
RUN apt-get update && apt-get upgrade -y && apt-get install -y tor
RUN pip install --no-cache-dir tornet
# CRITICAL: by default Tor binds SOCKS to 127.0.0.1, which is unreachable# from another container. Bind it to all interfaces instead.RUN echo "SocksPort 0.0.0.0:9050" >> /etc/tor/torrc
EXPOSE 9050
CMD ["tornet", "--interval", "60", "--count", "0"]
Let me know if you need more details or there any other workaround. Thanks and appreciate great app!
Thanks for reporting this and for including the details.
You're correct — inside most Docker containers, systemd is not running as PID 1, so systemctl reload tor will fail. In containerized environments, sending a HUP signal directly to the Tor process is the appropriate way to request a configuration reload and circuit rotation:
killall -HUP tor
I'll update tornet to detect container environments and fall back to signaling the Tor process instead of relying solely on systemctl.
As a temporary workaround, using killall -HUP tor (or pkill -HUP tor) should allow IP rotation to work inside Docker containers.
Thanks for identifying this edge case and for suggesting the fix.
Activity
dmitrisky commentedon May 25, 2026
For containers, following command might be used to reload tor:
mrfidal commentedon Jun 12, 2026
Thanks for reporting this and for including the details.
You're correct — inside most Docker containers,
systemdis not running as PID 1, sosystemctl reload torwill fail. In containerized environments, sending a HUP signal directly to the Tor process is the appropriate way to request a configuration reload and circuit rotation:I'll update tornet to detect container environments and fall back to signaling the Tor process instead of relying solely on
systemctl.As a temporary workaround, using
killall -HUP tor(orpkill -HUP tor) should allow IP rotation to work inside Docker containers.Thanks for identifying this edge case and for suggesting the fix.