🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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 →
  1. Q1. What is the relationship between a Docker image and a container?
  2. Q2. What does docker run -p 8080:80 nginx do?
  3. Q3. Why copy package.json and run npm ci before copying the rest of the code?
  4. Q4. In the Compose file, how does the web service reach the database?
  5. Q5. Where should database data live so it survives removing the container?
  6. Q6. Why do containers start much faster than virtual machines?
  7. Q7. What is a container registry?
  8. Q8. Why use a multi-stage build?
  9. Q9. An app inside a container listens on 127.0.0.1:3000 and docker run -p 3000:3000 does not reach it. Why?
  10. Q10. What does docker compose down -v do that docker compose down does not?