CompTIA Linux+ (XK0-005) — Question 192

A developer needs to launch an Nginx image container, name it Web00l, and expose port 8080 externally while mapping to port 80 inside the container. Which of the following commands will accomplish this task?

Answer options

Correct answer: C

Explanation

The correct command is C, as 'docker run' is used to create and start a new container from an image. Options A and B are incorrect because 'docker exec' is for running commands in an existing container and 'docker load' is for loading images, not running containers. Option D is also wrong because 'docker pull' is used to download images from a registry, not to run them.