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

HTTP ports exposed in interact hook do not match the dockerfile EXPOSE #112

Open
cmacdonald opened this issue Jun 28, 2019 · 3 comments
Open

Comments

@cmacdonald
Copy link
Member

Hence its difficult to document which ports a user should connect to.
See for example this from Terrier:
image

The jig could simply assume that it should expose the ports as they were requested.

@arjenpdevries
Copy link
Member

arjenpdevries commented Jun 28, 2019

I think (...) that the first time you run a docker exposing that port, it actually uses the port you request - but then the port is not available for the next time you run a docker exposing that port, so it automatically maps to a different one.

I.e., it is docker not the jig doing that, as far as I understand.

@ryan-clancy
Copy link
Member

Yeah, by default Docker uses a random port on the host side so that containers that require the same port don't collide (i.e., we could both run a MySQL container on a server without colliding with each other).

We can add in some explicit port mappings within the jig (after the workshop, currently have no bandwidth) that are passed through to Docker.

@arjenpdevries
Copy link
Member

arjenpdevries commented Jun 28, 2019

After starting jig in interact mode, this command gives you the actual mapping:

docker port $(docker ps -aql)

If you expose 50000/tcp like us, you can request just the port number using:

 docker inspect --format='{{(index (index .NetworkSettings.Ports "50000/tcp") 0).HostPort}}' $(docker ps -aql)

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

No branches or pull requests

3 participants