thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

DevOps & Automation · Foundational

Port Publishing

Mapping a host port to a container port so external clients can reach a containerized service.

Definition

docker run -p host:container creates NAT rules; EXPOSE in a Dockerfile only documents ports and does not publish them. -P publishes all exposed ports to random high ports.

Example

docker run -p 8443:443 web maps host 8443 to container 443.

Exam tip

EXPOSE does not publish a port; -p does.

Related terms