← All topics
Quiz: Docker and Containers: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. What is the relationship between a Docker image and a container?
- Q2. What does docker run -p 8080:80 nginx do?
- Q3. Why copy package.json and run npm ci before copying the rest of the code?
- Q4. In the Compose file, how does the web service reach the database?
- Q5. Where should database data live so it survives removing the container?
- Q6. Why do containers start much faster than virtual machines?
- Q7. What is a container registry?
- Q8. Why use a multi-stage build?
- Q9. An app inside a container listens on 127.0.0.1:3000 and docker run -p 3000:3000 does not reach it. Why?
- Q10. What does docker compose down -v do that docker compose down does not?