Beginner Docker & Containers
Q15 / 100

What is the purpose of port mapping with "docker run -p 8080:80"?

Correct! Well done.

Incorrect.

The correct answer is B) It forwards traffic from port 8080 on the host machine to port 80 inside the container

B

Correct Answer

It forwards traffic from port 8080 on the host machine to port 80 inside the container

Explanation

The "-p hostPort:containerPort" flag publishes a container's port to the host, so requests to host port 8080 are forwarded to port 80 inside the container.

Progress
15/100