EXPOSE

The Dockerfile instruction that documents which port the application listens on; it does not publish anything.

In more detail

EXPOSE 8000 is a note for people and tools. To reach the service from the host you still publish a port with -p when running (or -P, which publishes every exposed port to a random host port).

Example

EXPOSE 8000

Related terms

Taught in

References

Certification courses