Issue
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: https://github.com/SitronNO/docker_ipv6_test
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 http://192.168.10.5:5678
Hello, World!
This will work (if you have changed the IP to your server
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 http://192.168.10.5:5678
Hello, World!