Skip to content

Dockerfile instructions: FROM, WORKDIR, COPY, RUN, EXPOSE, USER

Select an icon to see what it is.

Step 5 of 6

EXPOSE only documents a port

EXPOSE 3000 records the port in Config.ExposedPorts as a note for people and tools. It does not publish anything, so the port is still not reachable from the host. You need -p to publish a port, and -P publishes every exposed port to a random host port.

Image config

{
"Config": {
"ExposedPorts": {
"3000/tcp": {}
}
}
}