Minimal alpine Dante Docker-Image with Configuration-Template
Pkg Source: https://pkgs.alpinelinux.org/packages?name=dante
Example docker-compose snippet:
alpine_dante:
image: h0tmann/alpine_dante:v1.4.4
container_name: alpine_dante
network_mode: host
environment:
# TIME
- TZ=Europe/Berlin
- LANG=de_DE.UTF-8
# ENV
# - PORT=1080 # default "1080"
# - ALLOW_CIDR=10.0.0.0/8 # default "10.0.0.0/8"
# - INTERFACE_INT=eth0 # default "eth0" | name of Interface
# - INTERFACE_EXT=eth0 # default "eth0" | name of Interface
# - SOCKS_METHOD=none # default "none"
# - CLIENT_METHOD=none # default "none"
# - COMPATIBILITY=sameport # default "sameport" | Possible values: "sameport" or "reuseaddr"
# - TIMEOUT_CONNECT=30 # default 30 | integer value in s
# - TIMEOUT_IO=7200 # default 7200 | integer value in s
# - SRC_HOST=nodnsmismatch nodnsunknown # default "nodnsmismatch nodnsunknown" | remove if no PTR provided
volumes:
# TIME
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
# DATA
- "/var/log/dante/:/var/log/dante/:rw"
deploy:
resources:
limits:
memory: 500M # adjust to your needs
restart: unless-stopped
after adding the docker compose run this quick-snippet:
mkdir -p /var/log/dante/ && chown 850:850 /var/log/dante/ && \
cd /var/docker/compose/ && docker compose pull && \
systemctl stop danted.service && systemctl disable danted.service && \
docker compose up -d --remove-orphans && docker logs -f alpine_dante
to use your own custom config run the container once and then copy it out:
grep -Ev '^\s*(#|$)' /etc/danted.conf # to get the substance of the old/original config
docker cp alpine_dante:/etc/sockd.conf.template .
then modify it in the way you need. Rebuild the container and have fun!
Note: you can run this docker-compose either with:
ports:
- 1080:1080
sysctls:
- net.ipv6.conf.all.disable_ipv6=0 # explicitely disable the disableing of IPv6
- net.ipv6.conf.eth0.proxy_ndp=1 # other IPv6 tweak
or with
network_mode: host
but please keep in mind, that without network_mode: host, the rules in the config may need to be altered to have the wanted effect.
As all requests are comming through the docker-network your docker-container is in.
I personally recommend network_mode: host, as it also makes it way more easy to migrate from a plain installation to this dockerized version.
Test functionality with one of these commands:
curl -x socks5://127.0.0.1:1080 -kv https://www.google.de
curl -x socks5h://127.0.0.1:1080 -kv https://www.google.de
curl -4 -x socks5://127.0.0.1:1080 -kv https://www.google.de
curl -4 -x socks5h://127.0.0.1:1080 -kv https://www.google.de
curl -6 -x socks5://127.0.0.1:1080 -kv https://www.google.de
curl -6 -x socks5h://127.0.0.1:1080 -kv https://www.google.de
IPv6 will be added on dante v1.5, see: https://www.inet.no/dante/
Content type
Image
Digest
sha256:b475973b6…
Size
10.9 MB
Last updated
6 months ago
docker pull h0tmann/alpine_dante:v1.4.4