-
Notifications
You must be signed in to change notification settings - Fork 2k
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
docker is not mapping dynamic ports #185
Comments
I was not able to connect to the redis server using the redis-cli (tried the obvious port numbers) when following the getting started guide - how can I determine the port? netstat didn't help much. (using ubuntu 14.04) |
I'm also hitting this issue, netstat returns nothing on the docker host. |
Just leaving this here for reference: It turns out the container port is accessible, it's just not mapped back to loopback on the docker host. You can find the correct IP by inspecting the docker container using this command (you have to run this on the host your container is running on). `$ docker inspect CONTAINER_ID | grep IPAddress`` You should then be able to connect using that IP/Port combination. It would be nice to be able to get this information from the nomad CLI :) |
+1 This option is not functioning properly, setting dynamic_ports["redis"] or dynamic_ports["6379"] would expect to map 6370 from the docker host through to the redis container however this is not happening on either localhost or the public ip of the docker/nomad host. Tested on CentOS 6, standard 'nomad init' example with either dynamic_ports setting on a 3 host nomad cluster with a server/client and 2 client slaves:
I would expect to see something like this in the port field:
nomad output looks like this:
|
Thanks @purehyperbole ! |
I think there might be some confusion on what dynamic ports means. When the job asks for a dynamic ports, the scheduler will pick any available port on the host. So asking for dynamic port REDIS will pick a random port. That is why you can't ping redis on its default host. Nomad sets an environment variable for each port so you can determine which port you were assigned as you can see in docker inspect. Please see: https://www.nomadproject.io/docs/jobspec/index.html#dynamic_ports I am going to close this issue as it is working as intended. |
@dadgar the problem I originally encountered was with the docker driver. Reading the I might have mis-read that (if so the docs could probably be a little more explicit IMO), but I think this is a scenario that makes a lot of sense and should be supported. |
I'd like to expand on my possible mis-reading of the docker driver docs. The docs states
Where did Having the code block almost looks like the start of a new subsection since it does not seem to be introduced by the previous paragraph. If the In this case higher layers randomly picked port |
@mmlb sorry I totally misread this. I am opening it back up. |
I still have this issue. Whatever combination of IP/Port I select the binding does not take effect. "HostConfig": { |
@vtuson Can you post your entire job config and which version of Nomad you're using? |
Sorry, I posted in the wrong thread. My problem is while using directly go-dockerclient lib |
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. |
Following the getting started guide I expected to see the dynamic redis ports mapped, but
docker port
returns empty. Possibly related to fsouza/go-dockerclient#220The text was updated successfully, but these errors were encountered: