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
Introspection of external port #1270
Comments
@terinjokes |
@crosbymichael: No, though the initial bug report isn't helpful. To clarify, it would be helpful if inside the docker instance, there was an official means to query about itself, including the external port being mapped to a local port. |
I agree this is needed. In 0.7 I would like to find a solution to a bunch of networking problems and requests. This is one of them. |
@shykes Do you have an idea of how this might work from the perspective of a image maintainer? I'm starting to work on improvements to the Dockerfile this affects, and would be open to providing feedback. |
Looks like part of this came in 0.6.5's |
As far as I can tell, the |
+1 for exporting host mapped ports via environment variables like the |
+1 to @mbrevoort for explaining what I'm wanting in a much more straightforward fashion. |
@mbrevoort What do we do when the container is not publishing a port to the docker host or publishes to localhost of the docker host machine? |
@crosbymichael I think the container should only be presented with the environment variables when the The One option would be to populate an environment variable with the SELF_8080_TCP_PORT=49153 However, if you use Maybe the host isn't included in this; maybe the host would have to be passed in with |
+1. In our situation we have a lot of containers coming and going and rely on dynamic port allocation. The applications inside the containers need to know how to tell the outside world how to route to themselves, knowing the host ip and external port are required. |
+1 Adding the ability to link to yourself would allow me to not run privileged containers (to use the API socket). |
+1 that feature would allow a container to announce itself for service discovery (using etcd for example). Currently that has to happen outside of the container (with a "sidekick" in CoreOS). |
It certainly would be nice if A simple but inefficient substitute for the above fits in a tweet or the more verbose: # Requires docker v.1.8.0 or later
while true ; do
for container in $(docker ps -q) ; do
docker inspect ${container} 2>&1 >/tmp/${container}.meta &&
docker cp /tmp/${container}.meta ${container}:/docker-metadata &&
rm /tmp/${container}.meta
sleep 5
done
done The above shell snippet probably constitutes a working fix for: #3778 #8427 #1270. |
Looks like this is a duplicate of #1270, which is opened after this issue, but has more activity, so for housekeeping I'll close this one |
For some services, it would be nice to be able to introspect the external port associated with an internal port.
The text was updated successfully, but these errors were encountered: