nerdexam
CompTIA

XK0-005 · Question #589

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…

The correct answer is C. docker run -it -p 8080:80 --name Web001 nginx. To launch an Nginx image container, name it Web001, and expose port 8080 externally while mapping to port 80 inside the container, the administrator can use the command docker run -it -p 8080:80 --name Web001 nginx ©. This will create and start a new container from the Nginx…

Scripting, Containers, and Automation

Question

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?

Options

  • Adocker exec -it -p 8080:80 --name Web001 nginx
  • Bdocker load -it -p 8080:80 --name Web001 nginx
  • Cdocker run -it -p 8080:80 --name Web001 nginx
  • Ddocker pull -it -p 8080:80 --name Web001 nginx

How the community answered

(21 responses)
  • B
    5% (1)
  • C
    90% (19)
  • D
    5% (1)

Explanation

To launch an Nginx image container, name it Web001, and expose port 8080 externally while mapping to port 80 inside the container, the administrator can use the command docker run -it -p 8080:80 --name Web001 nginx ©. This will create and start a new container from the Nginx image, assign it a name of Web001, and map port 8080 on the host to port 80 on the container.

Topics

#Docker#Containerization#docker run#Port mapping

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice