EXPOSE instruction
The EXPOSE instruction records the network ports that a container image is intended to provide, without publishing those ports to the host.
.NET in Action, Second Edition
The EXPOSE instruction documents a container port on which an application listens without publishing that port to the host.
- How it is used
- Configures a Dockerfile to document the HTTP port used inside a .NET application container.
- How deep it goes
- Defines the instruction and distinguishes internal exposure from host publishing through focused Dockerfile examples.
- Examples
- Uses ports 5101 and 80 in development and published multistage Dockerfiles.
- What you can do after
- Configure a Dockerfile with the port an ASP.NET Core application listens on inside its container.
Read how .NET in Action, Second Edition explains EXPOSE instruction →
Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more
A container image build directive that documents the network ports intended to be exposed by a container.
- How it is used
- Documents image ports for Podman containers and supports automatic host connections with --publish-all.
- How deep it goes
- Defines port metadata and its --publish-all behavior, without detailing manual publishing or application-level networking.
- Examples
- Uses EXPOSE 8080 and podman run --publish-all as concrete operational examples.
- What you can do after
- Operate containers with podman run --publish-all using ports recorded by EXPOSE.
Related concepts
- Dockerfilepart of · A Dockerfile is a text file containing declarative instructions for building a container image and specifying its contents and runtime metadata.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

