exam questions

Exam 200-901 All Questions

View all questions & answers for the 200-901 exam

Exam 200-901 topic 1 question 282 discussion

Actual exam question from Cisco's 200-901
Question #: 282
Topic #: 1
[All 200-901 Questions]

Which two commands download and execute an Apache web server container in Docker with a port binding 8080 in the container to 80 on the host? (Choose two.)

  • A. docker pull apache
  • B. docker run –p 8080:80 httpd
  • C. docker run –p 80:8080 httpd
  • D. docker pull httpd
  • E. docker pull https
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

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
chris_edwards
Highly Voted 1 year, 12 months ago
Selected Answer: CD
To download and run an Apache web server container in Docker with a port binding of 8080 in the container to port 80 on the host, you can use the following two commands: 1. docker pull httpd:latest - This command will download the latest version of the Apache web server Docker image from the Docker Hub. 2. docker run -p 80:8080 -d httpd - This command will start a new container based on the httpd image, with a port binding of 8080 in the container to port 80 on the host. The -d flag runs the container in detached mode, meaning it will run in the background and not block the terminal.
upvoted 5 times
...
nospampls
Highly Voted 1 year, 11 months ago
Selected Answer: CD
https://www.youtube.com/watch?v=6by0pCRQdsI -p host:container
upvoted 5 times
nospampls
1 year, 11 months ago
https://docs.docker.com/engine/reference/run/#expose-incoming-ports
upvoted 1 times
...
...
Final5150
Most Recent 2 weeks, 4 days ago
Selected Answer: CD
The command docker run -p host_port:container_port image_name is used to map a port on the host machine to a port inside a Docker container. docker run: This initiates the creation and execution of a new container. -p host_port:container_port: This is the port mapping flag. host_port: The port on the host machine that will be exposed. container_port: The port inside the container that the host port will be mapped to. image_name: The name of the Docker image to use for creating the container. For example, docker run -p 8080:80 nginx maps port 8080 on the host to port 80 inside the container running the nginx image. This means that requests to localhost:8080 on the host machine will be forwarded to the nginx server running on port 80 inside the container. Key Points: Host Port: This is the port on your local machine that you use to access the application running in the container. Container Port: This is the port that the application inside the container is listening on.
upvoted 1 times
...
kymoni
8 months, 3 weeks ago
Selected Answer: CD
"a port binding 8080 in the container to 80 on the host" Docker documentation specifies the order "-p host:container" C and D are correct
upvoted 1 times
...
louisvuitton12
11 months, 1 week ago
Selected Answer: BD
B and D period
upvoted 1 times
...
osamodas
1 year, 3 months ago
Selected Answer: AB
To download and execute an Apache web server container in Docker with a port binding where port 8080 in the container is mapped to port 80 on the host, you need to use the docker pull command to pull the Apache image and the docker run command to start the container with the appropriate port mapping. Here are the two commands to achieve this: Download the Apache image: A. docker pull httpd This command pulls the Apache HTTP Server image (httpd) from the Docker Hub. Execute the Apache container with port mapping: B. docker run -p 8080:80 httpd This command runs the Apache container with port 8080 on the host mapped to port 80 in the container. The -p option specifies the port mapping. So, options B and D are the correct commands for downloading and executing an Apache web server container with the specified port binding.
upvoted 2 times
...
ymmit78
1 year, 3 months ago
"-p=[] : Publish a container's port or a range of ports to the host format: ip:hostPort:containerPort" aka 80 (host port) : 8080 (internal port)
upvoted 1 times
...
cerifyme85
1 year, 11 months ago
Selected Answer: BD
As per outrageous7
upvoted 1 times
...
outrageous7
2 years ago
Selected Answer: BD
<port you are exposing>:<internal port> that's the way !!
upvoted 3 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 ...