liveBook · Manning

EXPOSE instruction

As explained in 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.

EXPOSE records the network ports intended for containers created from an image. It documents image metadata rather than defining the container's default command or environment. section 2.3.1

When you run podman run --publish-all ..., Podman reads the image's EXPOSE ports and connects them to ports on the host. section 2.3.1

Declare port 8080

EXPOSE 8080

How Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more covers it

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 it assumes
Assumes basic Containerfile and Podman run knowledge while defining EXPOSE's image-level role.
What you can do after
Operate containers with podman run --publish-all using ports recorded by EXPOSE.
How it connects
Connects Containerfiles, container images, Podman run, and OCI runtime specifications.

Also explained in

Compare how 2 books explain EXPOSE instruction →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more. The section links point to the parts of the book it draws on.