Q19 /20 What are Docker images and Docker containers?
Accenture technical mcq question, verified with a worked answer. Free to practise - no sign-up.
What are Docker images and Docker containers? Choose the correct option.
Show answer & explanation
Answer: B. Docker containers are units of an OS, datafiles, and applications, including all dependencies between libraries used in the applications. A Docker image is an archive file that contains everything that can be used for Docker containers.
Docker images are read-only templates (archive files) that contain all dependencies, code, and configurations needed to run an application. Docker containers are the running instances created from those images—they are the actual executable units combining OS, datafiles, and applications. Option B correctly reverses the relationship: images are the static archives; containers are the dynamic units of execution.
Step-by-step Derivation:
Conceptual understanding of Docker architecture:
- Docker Image: A lightweight, standalone, executable package. It's a blueprint stored as an archive file containing the application, runtime, libraries, and dependencies.
- Docker Container: A runtime instance created by executing a Docker image. It includes the OS, datafiles, and running application with all dependencies bound together.
- Relationship: Image → (instantiate) → Container.
Option A incorrectly swaps the definitions.
Option C and D both incorrectly describe containers as files—containers are running processes, not files.
Option B correctly identifies containers as the executable units and images as archive files used to create them.