Skip to content

Cannot disable IPv6 in nginx container  #712

Open
@Aekal

Description

@Aekal

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions