Skip to content

Instantly share code, notes, and snippets.

@bidipeppercrap
Created July 28, 2020 15:56
Show Gist options
  • Select an option

  • Save bidipeppercrap/0948f07c0712c619ac0dbc01d72e3760 to your computer and use it in GitHub Desktop.

Select an option

Save bidipeppercrap/0948f07c0712c619ac0dbc01d72e3760 to your computer and use it in GitHub Desktop.

Docker Network

Most of the time, you want to change on which network the containerized app has to listen.
For example, we want to containerized app to listen on localhost:5000 of our machine (host).
We run the docker with --network="host" so the containerized app will listen to the host network instead of its own container network.

docker run --network="host" -d --name myapp myimage

Using host network will remove port binding of the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment