File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1073,7 +1073,10 @@ so the ports _inside_ the container are different
1073
1073
from the ports _outside_ the container, the ones we can see on our host machine.
1074
1074
1075
1075
So we need to tell Docker to connect the internal ports to the outside ones,
1076
- or "expose" them, in Docker terminology.
1076
+ to "publish" or "map" them, in Docker terminology.
1077
+ // CSANAD: "expose" is different, it's for inter-container communication and it's
1078
+ // done by the EXPOSE instruction in the Dockerfile. The -p is short for
1079
+ // --publish and this is port mapping.
1077
1080
1078
1081
`docker run` takes a `-p` argument, with the syntax `OUTSIDE:INSIDE`.
1079
1082
So you can actually map a different port number on the inside and outside.
@@ -1112,7 +1115,7 @@ curl: (52) Empty reply from server
1112
1115
1113
1116
==== Essential Googling the Error Message
1114
1117
1115
- The need to expose ports and the `-p` argument to `docker run` are something you just learn,
1118
+ The need to map ports and the `-p` argument to `docker run` are something you just learn,
1116
1119
fairly on in learning Docker. But the next debugging step is quite a bit more obscure
1117
1120
(although admittedly Itamar does address it in his
1118
1121
https://pythonspeed.com/articles/docker-connection-refused/[docker networking article],
You can’t perform that action at this time.
0 commit comments