socks-proxy / Dockerfile
bla's picture
Update Dockerfile
a23bc3c verified
# Use the lightweight Alpine Linux as the base image
FROM alpine:latest
# Install dante-server
RUN apk add --no-cache dante-server
# Create a simple configuration file for dante-server
RUN { \
echo "logoutput: stderr"; \
echo "internal: 0.0.0.0 port = 1080"; \
echo "external: eth0"; \
echo "socksmethod: none"; \ # Updated from 'method' to 'socksmethod'
echo "user.privileged: root"; \
echo "user.notprivileged: nobody"; \
echo "client pass {"; \
echo " from: 0.0.0.0/0 to: 0.0.0.0/0"; \
echo " log: connect disconnect error"; \
echo "}"; \
echo "socks pass {"; \
echo " from: 0.0.0.0/0 to: 0.0.0.0/0"; \
echo " log: connect disconnect error"; \
echo "}"; \
} > /etc/sockd.conf
# Expose the SOCKS proxy port
EXPOSE 1080
# Set capabilities and permissions
RUN setcap 'CAP_NET_BIND_SERVICE=+eip CAP_NET_ADMIN=+eip' /usr/sbin/sockd && \
chmod 644 /etc/sockd.conf
# Start the dante-server using the configuration file
CMD ["sockd", "-f", "/etc/sockd.conf"]