osirrc / jig

Jig for the Open-Source IR Replicability Challenge (OSIRRC)
13 stars 3 forks source link

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

Open cmacdonald opened 5 years ago

cmacdonald commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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)