Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out empty DNS entries #11690

Open
IvanRibakov opened this issue Apr 5, 2024 · 1 comment
Open

Filter out empty DNS entries #11690

IvanRibakov opened this issue Apr 5, 2024 · 1 comment

Comments

@IvanRibakov
Copy link

Description

Previously this DockerCompose configuration would successfully start a container:

# ANOTHER_SERVICE_IP is not set and defaults to blank string
dns: ${ANOTHER_SERVICE_IP}

But using latest Docker+DockerCompose on Linux

Docker version 26.0.0, build 2ae903e
Docker Compose version v2.25.0

container fails to start:

WARN[0000] The "ANOTHER_SERVICE_IP" variable is not set. Defaulting to a blank string. 
Error response from daemon: bad nameserver address : ParseAddr(""): unable to parse IP

https://github.com/moby/moby/blob/d25b0bd7ea6ce17ca085c54d5965eeeb66417e52/libnetwork/sandbox_dns_unix.go#L259-L269

I can see how it makes sense from Docker perspective to be strict about supplied configuration options. I'm wondering whether it would be possible for the DockerCompose to filter out empty DNS entries before passing them to Docker and logging a warning. As far as I understand there is no other way to have a conditional behaviour that either uses external DNS service or the default host one without creating 2 different service configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants