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

Allow specifying container IP with docker driver #2535

Merged
merged 2 commits into from
Apr 7, 2017

Conversation

clinta
Copy link
Contributor

@clinta clinta commented Apr 7, 2017

The ability to specify a container IP was added in docker 1.13.0. This PR exposes those options to nomad.

@dadgar
Copy link
Contributor

dadgar commented Apr 7, 2017

What is the use case of this?

@clinta
Copy link
Contributor Author

clinta commented Apr 7, 2017

We run dns servers in docker containers which need to be started with a specific IP addresses. We've been doing this with docker for quite a while, but would like to start using nomad to schedule our containers on our hosts.

@dadgar
Copy link
Contributor

dadgar commented Apr 7, 2017

And to be clear this is in a docker, user defined network?

@clinta
Copy link
Contributor Author

clinta commented Apr 7, 2017

That is how we use it, yes. But the --ip and --ip6 options for docker are supported for all network types.

https://docs.docker.com/engine/reference/run/#network-settings

@dadgar
Copy link
Contributor

dadgar commented Apr 7, 2017

@clinta we will probably want to restrict that to non "host" networks. Otherwise the scheduler will be incorrectly accounting IPs.

@clinta
Copy link
Contributor Author

clinta commented Apr 7, 2017

Actually, I was wrong. The documentation does not indicate that there are any restrictions, but I just tried it for testing and it is indeed only permitted on user defined networks.

docker run --net=host --rm --ip 192.168.10.5 busybox
docker: Error response from daemon: user specified IP address is supported on user defined networks only.

@@ -144,6 +144,12 @@ The `docker` driver supports the following configuration in the job spec:
}
```

* `ipv4_address` - (Optional) The IPv4 address to be used for the container. In
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update this make it clear that it only works on user defined networks.

@dadgar
Copy link
Contributor

dadgar commented Apr 7, 2017

Thanks!

@github-actions
Copy link

github-actions bot commented Apr 2, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants