Skip to content

Conversation

@Meroje
Copy link
Contributor

@Meroje Meroje commented Feb 24, 2023

Description

When testing over an ipv6-only stack I noticed the frontend would not be reachable, as nginx listens on ipv4 only by default. This change adds the second required directive.

Addressed Issue

Additional Details

Checklist

Signed-off-by: Jérôme Foray <jerome.foray@bedrockstreaming.com>
@rissson
Copy link
Contributor

rissson commented Jun 1, 2023

We are also hitting this issue. This makes it work in all situations, ipv4-only, ipv6-only, and dualstack. Any chance this might get some attention?

Copy link
Member

@nscuro nscuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Meroje!

@nscuro nscuro added enhancement New feature or request docker Pull requests that update Docker code labels Jun 12, 2023
@nscuro nscuro added this to the 4.9 milestone Jun 12, 2023
@nscuro nscuro merged commit f9c84dd into DependencyTrack:master Jun 12, 2023
@Meroje Meroje deleted the patch-1 branch June 13, 2023 12:50
@schmidi
Copy link

schmidi commented Oct 23, 2023

Unfortunately this change breaks my IPv4-only installation... Is there a way to make this configurable?

@nscuro
Copy link
Member

nscuro commented Oct 23, 2023

@schmidi In what sense is it breaking? I was under the assumption that it should work for both IPv4 and IPv6.

@schmidi
Copy link

schmidi commented Oct 23, 2023

@schmidi In what sense is it breaking? I was under the assumption that it should work for both IPv4 and IPv6.

When I try to start the container on a server without IPv6 I get the following message:

Attaching to dtrack_dtrack-apiserver_1, dtrack_dtrack-frontend_1
dtrack-frontend_1   | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
dtrack-frontend_1   | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
dtrack-frontend_1   | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
dtrack-frontend_1   | 10-listen-on-ipv6-by-default.sh: info: ipv6 not available
dtrack-frontend_1   | /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
dtrack-frontend_1   | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
dtrack-frontend_1   | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-oidc-configuration.sh
dtrack-frontend_1   | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
dtrack-frontend_1   | /docker-entrypoint.sh: Configuration complete; ready for start up
dtrack-frontend_1   | 2023/10/23 09:34:01 [emerg] 1#1: socket() [::]:8080 failed (97: Address family not supported by protocol)
dtrack-frontend_1   | nginx: [emerg] socket() [::]:8080 failed (97: Address family not supported by protocol)
dtrack-frontend_1   | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-oidc-configuration.sh
dtrack-frontend_1   | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
dtrack-frontend_1   | /docker-entrypoint.sh: Configuration complete; ready for start up
dtrack-frontend_1   | 2023/10/23 09:34:02 [emerg] 1#1: socket() [::]:8080 failed (97: Address family not supported by protocol)
dtrack-frontend_1   | nginx: [emerg] socket() [::]:8080 failed (97: Address family not supported by protocol)

nscuro added a commit to nscuro/dependency-track-frontend that referenced this pull request Oct 23, 2023
This is a regression introduced in DependencyTrack#427.

The original NGINX image has a mechanism to enable IPv6 when it's available: https://github.com/nginxinc/docker-nginx-unprivileged/blob/1.25.2/entrypoint/10-listen-on-ipv6-by-default.sh

 However, that mechanism is disabled when the `default.conf` file was modified (which we did).

 This commit copies the entrypoint script from the base image, and modifies it, to make it work with our custom `default.conf`.

 Fixes DependencyTrack#427 (comment)

Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro
Copy link
Member

nscuro commented Oct 23, 2023

Found the issue as well as the solution: #621

Will backport this to 4.9.1. Thanks for raising the issue @schmidi!

@schmidi
Copy link

schmidi commented Oct 23, 2023

@nscuro Thanks for the fast reply and the fix.

nscuro added a commit to nscuro/dependency-track-frontend that referenced this pull request Oct 23, 2023
This is a regression introduced in DependencyTrack#427.

The original NGINX image has a mechanism to enable IPv6 when it's available: https://github.com/nginxinc/docker-nginx-unprivileged/blob/1.25.2/entrypoint/10-listen-on-ipv6-by-default.sh

 However, that mechanism is disabled when the `default.conf` file was modified (which we did).

 This commit copies the entrypoint script from the base image, and modifies it, to make it work with our custom `default.conf`.

 Fixes DependencyTrack#427 (comment)

Signed-off-by: nscuro <nscuro@protonmail.com>
@Meroje
Copy link
Contributor Author

Meroje commented Oct 24, 2023

Well sorry about that, it never failed me but I guess I usually let ipv6 be un-routable rather than disabling it outright. Thanks for putting in in a better fix ❤️

@rissson rissson mentioned this pull request Oct 14, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Pull requests that update Docker code enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants