I have ipv6 enabled on the docker host, but there is one specific container in which ipv6 is causing problems. Is there a way to start the container without ipv6 support, either using the command line argument or the dockerfile directive?
Unfortunately, no: --ipv6- this is a flag of the entire area of the daemon that cannot be redefined for each container.
--ipv6
Two options:
--dns-opt='options single-request'
--sysctl net.ipv6.conf.all.disable_ipv6=1
. , , ip:
docker run --name YourDockerContainer -p 192.168.99.100:80:80
ip: 192.168.99.100.
192.168.99.100
docker --sysctl net.ipv6.conf.all.disable_ipv6=1 , , .
--sysctl net.ipv6.conf.all.disable_ipv6=0
Worked for me:
docker run -d -i -t --name django_1.0 --sysctl net.ipv6.conf.all.disable_ipv6=1 -p 192.168.20.148:8000:8000/tcp -p 192.168.20.148:8000:8000/udp -p 192.168.20.148:3000:3000/tcp -p 192.168.20.148:3000:3000/udp IMAGE_NAME root:~# netstat -tlp | grep -i docker tcp 0 0 ip-192-168-20-148.:8000 *:* LISTEN 4598/docker-proxy tcp 0 0 ip-192-168-20-148.:3000 *:* LISTEN 4642/docker-proxy