openspeedtest / Docker-Image

OpenSpeedTest Docker Image
124 stars 26 forks source link

Container won't start in IPv4 only system #1

Closed Stolz closed 1 year ago

Stolz commented 1 year ago

My system does not support IPv6, only IPv4. It seems the Nginx config has a listen directive with IPv6 address hardcoded, which prevents the container from starting:

open-speed-test  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
open-speed-test  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
open-speed-test  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
open-speed-test  | 10-listen-on-ipv6-by-default.sh: info: ipv6 not available
open-speed-test  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
open-speed-test  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
open-speed-test  | /docker-entrypoint.sh: Configuration complete; ready for start up
open-speed-test  | 2022/11/16 05:23:34 [emerg] 1#1: socket() [::]:3000 failed (97: Address family not supported by protocol)
open-speed-test  | nginx: [emerg] socket() [::]:3000 failed (97: Address family not supported by protocol)

Is there any way to provide the bind address on run time?

openspeedtest commented 1 year ago

This is a known issue, you can mount our nginx config after disabling IPV6, is one solution. To make this process runtime we need a shell script, that check the status and provide a configuration that works.

Some deployments Only have IPV6 Other with Only IPV4 Most of them have both IPV4 and IPV6

Currently I am not good at writing shell script. So for now, modify the config and mount it. If someone can help me with shell script, then please open a PR.

Need a shell script like this

By default copy the current config with IPV4 and IPV6, Check that IP status if IPV4 only -> Copy IPV4-Only.Config , if IPV6 Only - > Copy IPV6 Only.Config and delete default config with IPV4 and IPV6.

redrac commented 1 year ago

I opened https://github.com/openspeedtest/Docker-Image/pull/2 which is a really basic entrypoint to check for ip v4 or v6 and remove them from the nginx config