From d7b00e2bd15953f587c2c09d88532a265bec8751 Mon Sep 17 00:00:00 2001 From: Maximillian Xavier Date: Tue, 29 Sep 2020 13:24:19 -0300 Subject: [PATCH] Add indication to use docker create/run on port mapping #11420 (#11429) * Add indication to use docker create/run on port mapping #11420 Co-authored-by: Sebastiaan van Stijn Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> Signed-off-by: Maximillian Fan Xavier --- config/containers/container-networking.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/containers/container-networking.md b/config/containers/container-networking.md index e58db37ebc..9e27f00179 100644 --- a/config/containers/container-networking.md +++ b/config/containers/container-networking.md @@ -19,7 +19,11 @@ point of view of the container. ## Published ports -By default, when you create a container, it does not publish any of its ports +By default, when you create or run a container using `docker create` or `docker run`, +it does not publish any of its ports to the outside world. To make a port available +to services outside of Docker, or to Docker containers which are not connected to +the container's network, use the `--publish` or `-p` flag. This creates a firewall +rule which maps a container port to a port on the Docker host. Here are some examples. to the outside world. To make a port available to services outside of Docker, or to Docker containers which are not connected to the container's network, use the `--publish` or `-p` flag. This creates a firewall rule which maps a container