In Podman run, what does the -p hostPort:containerPort mapping accomplish?

Prepare for the Red Hat OpenShift Developer II DO288 Exam with our quizzes. Study with flashcards and multiple choice questions, each with hints and explanations. Get ready for your certification!

Multiple Choice

In Podman run, what does the -p hostPort:containerPort mapping accomplish?

Explanation:
Port mapping with -p hostPort:containerPort means the host port is the entry point, and traffic is forwarded to the container’s port. So -p 8080:80 makes port 8080 on the host forward to port 80 inside the container. This is why the correct description is: forward host port 8080 to container port 80. When you navigate to http://localhost:8080 on the host, you’re reaching the service listening on port 80 inside the container.

Port mapping with -p hostPort:containerPort means the host port is the entry point, and traffic is forwarded to the container’s port. So -p 8080:80 makes port 8080 on the host forward to port 80 inside the container. This is why the correct description is: forward host port 8080 to container port 80. When you navigate to http://localhost:8080 on the host, you’re reaching the service listening on port 80 inside the container.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy