DockerInterview preparation
Intermediate·Concept·2 min read

Image vs container vs Dockerfile?

Practice this question

Definition:

A Docker image packages a filesystem and configuration for starting an application. A container is an isolated process environment created from an image with a writable layer and runtime settings. A Dockerfile describes how the image is built, making the package reproducible rather than depending on manual server setup.

Key points:

  • An image is the packaged filesystem and configuration for an app.

  • A container is an instance of that image; it may be running or stopped.

  • A Dockerfile describes image build steps; containers share the host kernel.

  • Containers share the host kernel; they are not full virtual machines with independent kernels.

Interview point:

  • Distinguish build-time content from runtime configuration and persisted application data.
Adapted from 09_TESTING_GIT_DOCKER_CLOUD.md · “Image vs container vs Dockerfile?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.