-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPv6 port mapping broken with docker 20.10.2 #70
Comments
Simply switching the default IP to |
Restarting a container is a backward compatibility breakage/issue? Adding a default host binding string looks good too, except it will introduce a new difference between the cli and the module. |
Yes, the module must not suddenly restart containers. That could destroy production data. |
I created PR #71 which adds an option |
@felixfontein could default_host_ip be also added to the docker_swarm_service_module? I really miss a solution there to bind to the host IPv6 |
@Henkhogan the docker_container module works totally different from the docker_swarm_service module. The latter does not do magic string transformations for idempotency checks. So something like a global option |
SUMMARY
The
docker_container
module set an IPv4 as default host forpublished_ports
.Since the last version of docker (20.10.2) and recent changes (see here),
0.0.0.0
doesn't bind on IPv6 anymore.So, containers defined like the following loose their dual stack binding when upgrading to docker 20.10.2. If containers were defined with the docker cli, upgrade would be transparent.
A user side workaround could to be force definition of a listening IPv6 host like the following.
This require to known if host is supporting IPv6 instead of having it configured automatically depending of the host support of an IPv6 stack.
N.B: I didn't find a way to push an empty string as host in
published_ports
.The difference between containers can be seen with the following commands:
SOLUTION
I suggest to mimic the docker cli behavior and change the default Host to an empty string.
This way, when users doesn't set an host for
published_ports
, dockerd chooses the correct binding.ISSUE TYPE
COMPONENT NAME
docker_container
ANSIBLE VERSION
OS / ENVIRONMENT
Arch Linux
STEPS TO REPRODUCE
A simple container like this is enough.
EXPECTED RESULTS
Docker container should be bound to IPv6 host addresses.
This ouput is with docker > 20.10. With older version the binding is on
*:8080
.ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: