docker
docker copied to clipboard
The same Docker image cannot work both on IPv4-only and IPv6 networks
Deployments with IPv6 require forking the image or overwriting nginx.conf.
When listening on listen [::]:80;, @pando85 reported in #189 that IPv4-only Docker installs do not work as Nginx is trying to bind on IPv6 and fails.
However, when binding on listen 80 in this repo's config, it appears that Nginx only binds on IPv4 and is not reachable over IPv6.
The issue seems more complex than I expected as the official Nginx Docker image itself is using an entrypoing bash script to replace the listen 80 line before running Nginx:
# enable ipv6 on default.conf listen sockets
sed -i -E 's,listen 80;,listen 80;\n listen [::]:80;,' /$DEFAULT_CONF_FILE
Any idea how to solve this and have the same image on
Related links:
- https://nginx.org/en/docs/http/ngx_http_core_module.html#listen
- https://github.com/nginxinc/docker-nginx/blob/2ef3fa66f2a434cd5e44e35a02f4ac502cf50808/stable/buster/10-listen-on-ipv6-by-default.sh#L57
- https://github.com/wallabag/docker/pull/173
- https://github.com/wallabag/docker/pull/189