CompTIA
CV0-004 · Question #294
Which of the following container commands implements network port mapping?
The correct answer is D. $docker run -it -p 80:8080 myimage. The -p option in docker run maps a host port to a container port, as shown in -p 80:8080, enabling network port mapping.
Deployment
Question
Which of the following container commands implements network port mapping?
Options
- A$docker run -it myimage -e /bin/port 8080
- B$docker run myimage:port
- C$docker run -it -p 1-65535 myimage -e netstat 8080
- D$docker run -it -p 80:8080 myimage
How the community answered
(35 responses)- A3% (1)
- B6% (2)
- C3% (1)
- D89% (31)
Explanation
The -p option in docker run maps a host port to a container port, as shown in -p 80:8080, enabling network port mapping.
Topics
#Docker#Container networking#Port mapping#CLI commands
Community Discussion
No community discussion yet for this question.