Developing Applications and Automating Workflows Using Cisco Platforms (DEVASC) — Question 269
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.)
Answer options
- 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
Correct answer: C, D
Explanation
The correct commands are D and C. 'docker pull httpd' retrieves the Apache image, while 'docker run –p 80:8080 httpd' runs the container, mapping the container's port 80 to the host's port 8080. Options A and B do not fulfill both criteria, as A does not run the container and B maps the ports incorrectly.