exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 205 discussion

Actual exam question from CompTIA's XK0-005
Question #: 205
Topic #: 1
[All XK0-005 Questions]

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?

  • A. docker exec -it -p 8080:80 --name Web001 nginx
  • B. docker load -it -p 8080:80 --name Web001 nginx
  • C. docker run -it -p 8080:80 --name Web001 nginx
  • D. docker pull -it -p 8080:80 --name Web001 nginx
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
NastyNutsu
2 months ago
Selected Answer: C
exec is used to run a command in a running container load is used to load an image from a tar archive run is used to start a new container pull is used to load an image from repository to launch something is to start something, C make sense.
upvoted 1 times
...
af67070
3 months, 2 weeks ago
Selected Answer: C
To start a container and map ports in Docker, you can use the docker run command with the -p or --publish flag: Syntax -p host_port:container_port Example: To map port 8080 on the host to port 80 inside the container, you can use -p 8080:80 Multiple port mappings: You can specify multiple port mappings by repeating the -p flag
upvoted 1 times
...
ericsrz
10 months ago
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? A. docker exec -it -p 8080:80 --name Web001 nginx B. docker load -it -p 8080:80 --name Web001 nginx C. docker run -it -p 8080:80 --name Web001 nginx D. docker pull -it -p 8080:80 --name Web001 nginx
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago