Search code examples
dockerportsfig

Is there a way to "publish" ports from a container when using "fig run"?


Sometimes when i need to debug the result of my image, i do run "/bin/bash" and do some look around on my image.

fig run www /bin/bash

From that point i can for instance, fire up a webserver myself at port 8080, but unfortunately i can't access that port from my "docker host".

Is there a way to "publish" ports from a container when using "fig run" ?


Solution

  • It is now possible to publish ports when using the run command with the --service-ports parameter in docker-compose.

    NB! The fig project has changed name to docker-compose, and is available here: https://docs.docker.com/compose/