Intermediate Vocabulary #docker #containers #devops #dockerfile

Docker & Containerization Vocabulary

5 exercises — CMD vs ENTRYPOINT, multi-stage builds, layer caching, named volumes vs bind mounts, and image tags vs digests.

0 / 5 completed
Docker vocabulary quick reference
  • CMD = overridable defaults; ENTRYPOINT = fixed executable; always use exec form (JSON array)
  • multi-stage build — multiple FROM; final stage copies only what's needed; drastically smaller images
  • layer cache — invalidated if inputs change; put slow instructions (install deps) before frequently-changing ones (COPY source)
  • named volume = Docker-managed persistent storage; bind mount = host path; down -v deletes named volumes
  • latest tag = mutable, non-deterministic; pin to specific version or digest (sha256: hash) for reproducibility
1 / 5
A Dockerfile review comment says: "Replace CMD ["node", "server.js"] with ENTRYPOINT here — you want the container to always run as a Node server and allow arguments to be passed." What is the difference between CMD and ENTRYPOINT?