docker-magento icon indicating copy to clipboard operation
docker-magento copied to clipboard

Cannot disable IPv6 in nginx container

Open Aekal opened this issue 2 years ago • 1 comments

Description I run the one-liner for automated setup:

curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/onelinesetup | bash -s -- magento.test 2.4.4

the installation went smooth but the nginx container didn't start. In container logs I'm getting an IPv6 error:

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: error: ipv6 not available
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2022/05/22 14:48:26 [emerg] 1#1: socket() [::]:8443 failed (97: Address family not supported by protocol)
nginx: [emerg] socket() [::]:8443 failed (97: Address family not supported by protocol)

I don't have an IPv6 on the host machine and I'm looking for a solution to run it on IPv4. So far I have tried to edit docker-compose.yml by adding:

network:
  enable_ipv6: false

and

sysctls:
  - net.ipv6.conf.all.disable_ipv6=1

but the container doesn't recreate with these applied options. I use Manjaro Linux.

Is there any other way to run the project without IPv6?

Expected Result nginx container should run on IPv4 if the host machine doesn't have an IPv6

Actual Result nginx container throws an error about missing IPv6

Aekal avatar May 22 '22 15:05 Aekal

Sorry, I've never had a need to run this as non-IPV6, so really not sure how to fix this. I'll add a help wanted tag for you.

markshust avatar Jun 13 '22 19:06 markshust