In this lesson, you will learn how to use the EXPOSE instruction for documenting which ports should be redirected to the outside world by someone using your image.

When your image hosts server software, it listens on one or several ports. For instance, an HTTP server generally listens on the TCP port 80.

You can make this explicit using an EXPOSE instruction:

Get hands-on with 1000+ tech skills courses.