200-901 · Question #185
200-901 Question #185: Real Exam Question with Answer & Explanation
The correct answer is D: docker run -p 8080:80 alpine:latest. {"question_number": 2, "question": "Which command creates a running container based on the tagged image, with the container port 8080 bound to port 80 on the host?", "correct_answers": ["D"], "explanation": "docker run is the correct command because it creates AND starts a new co
Question
A local Docker alpine image has been created with an image ID of a391665405fe and tagged as "latest". Which command creates a running container based on the tagged image, with the container port 8080 bound to port 80 on the host?
Options
- Adocker build -p 8080:80 alpine:latest
- Bdocker exec -p 8080:80 alpine:latest
- Cdocker start -p 8080:80 alpine:latest
- Ddocker run -p 8080:80 alpine:latest
Explanation
{"question_number": 2, "question": "Which command creates a running container based on the tagged image, with the container port 8080 bound to port 80 on the host?", "correct_answers": ["D"], "explanation": "docker run is the correct command because it creates AND starts a new container from an image in a single step. The -p host_port:container_port flag maps host port 80 to container port 8080, so the syntax -p 8080:80 maps container port 8080 to host port 80. The other commands are wrong: docker build builds images from Dockerfiles, docker exec runs a command inside an already-running container, and docker start restarts a stopped (already existing) container - none accept -p.", "generated_by": "claude-sonnet", "llm_judge_score": 4}
Topics
Community Discussion
No community discussion yet for this question.