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

Can't interpolate in docker dns_servers field #1214

Closed
kyhavlov opened this issue May 29, 2016 · 7 comments
Closed

Can't interpolate in docker dns_servers field #1214

kyhavlov opened this issue May 29, 2016 · 7 comments

Comments

@kyhavlov
Copy link
Contributor

kyhavlov commented May 29, 2016

Nomad version

Nomad v0.3.2

Issue

Nomad doesn't seem to interpolate variables in the dns_servers field; the list of DNS servers doesn't get provided to the container until runtime so Nomad should have access to them at that point. It also won't work with 'meta' fields or environment variables.

What I'm trying to do is pass the ip of the node so that the container can use the local consul agent for DNS. If there's another way to pass the address in dynamically that would work too, but I couldn't find one.

Nomad Server logs (if appropriate)

[ERR] driver.docker: invalid ip address for container dns server: ${attr.unique.network.ip-address}

Job file (if appropriate)

task "app-container" {
    driver = "docker"

    config {
        image = "hello-world"
        dns_servers = ["${attr.unique.network.ip-address}"]
    }
}
@jacqvdm
Copy link

jacqvdm commented Oct 11, 2016

Greetings @diptanu - any idea when this will be worked on?

@kyhavlov
Copy link
Contributor Author

For posterity, the way I ended up doing this was to set "--dns=${NODE_IP}" on the args for the docker daemon.

@rokka-n
Copy link

rokka-n commented Feb 1, 2017

@kyhavlov how did you configure consul/dnsmasq on the host?

@kyhavlov
Copy link
Contributor Author

kyhavlov commented Feb 1, 2017

@rokka-n I set consul's -client option to the docker0 interface (172.17.0.1) and port 53.

@rokka-n
Copy link

rokka-n commented Feb 1, 2017

Thank you, all worked.
I bind dnsmasq to all interface.

@dadgar
Copy link
Contributor

dadgar commented Feb 1, 2017

Fixed in 0.5.0: #1965

@dadgar dadgar closed this as completed Feb 1, 2017
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants