Docker Community Forums

Share and learn in the Docker community.

IPv6 does not work i Swarm

(Sitronno) #1

I have a server running both IPv4 and IPv6 (dual-stack). This server is also running Docker. However, I have problems whenever I try to access the containers in the swarm, but only over IPv6.

Technical info
Ubuntu 16.04 LTS, 64bit, with Docker version 18.06.1-ce, build e68fc7a

Steps to reproduce
A list of my all code, Dockerfiles, (verification) steps is also listed on my GitHub:

Step 1: Create a simple webserver, I choose an example from gunicorn
Run it: gunicorn -w 4 -b [::]:5678 myapp:app

Verify from another client with:
curl --connect-timeout 15 http://[2001:db8:db0::5]:5678
Hello, World!

curl --connect-timeout 15
Hello, World!
This will work (if you have changed the IP to your server :slight_smile:

Step 2: Build and run the service via Docker:
docker build -t docker_ipv6_test .
docker run --rm --init -p 5678:5678 docker_ipv6_test

A new verification (as above), and you will see that this works.

Step 3: Deploy with Docker
docker stack deploy -c docker-compose.yml ipv6_test

Verification will show that it works with IPv4, but not IPv6:
curl --connect-timeout 15 http://[2001:db8:db0::5]:5678
curl: (28) Operation timed out after 0 milliseconds with 0 out of 0 bytes received

curl --connect-timeout 15
Hello, World!