RESEARCH NOTES

A beginner’s guide to Docker

What is Docker? Imagine planning a camping trip and cooking a generous lunch outdoors. Change the ingredients, equipment or preparation, and the meal can turn out differently each time. A prepared meal is appealing because some of that work has already been done, reducing what must be improvised on site.

Docker is something like a prepared-meal factory: it packages an application, its runtime and dependencies into a distributable image, from which containers can be started. This reduces differences between development, testing and deployment. But taking the meal along does not mean taking the whole kitchen. Docker makes some runtime conditions easier to fix; it does not guarantee identical results on every machine. The operating system, CPU architecture and mounted data still matter. Multi-platform images provide appropriate variants for different platforms.

Chapter 1: Install Docker and set up the kitchen↗

Docker Desktop provides Docker on Windows, macOS and Linux; Linux can also run Docker Engine directly. Follow the official installation entry point for the relevant system rather than copying one installation command across platforms.

Installing the client is only part of the setup: it must also be able to reach a running Docker service. The ordering system and the kitchen doing the work are separate parts.

Chapter 2: Meet the lunch box↗

The meal analogy helps, provided the recipe is distinguished from the prepared food:

Table 1. Docker terms and the kitchen analogy: useful correspondences, not complete equivalences
Concept What it is in Docker Kitchen analogy
Dockerfile A text file describing image-building steps Recipe
Image An immutable, layered package of files, programs, dependencies and default configuration Prepared food ready to distribute
Container An instance created from an image that can be started or stopped One actual opening and use
Client / Daemon The client sends requests; the daemon manages images, containers and other objects Ordering system / kitchen

An image is not the recipe itself; Dockerfile fits that analogy better. A container is an isolated process and its runtime environment, rather than a standalone virtual machine with its own complete kernel. Ordinary Linux containers share the Linux kernel running them.

Chapter 3: Create the first container↗

The first lunch box can be a small program from the official installation example. Once Docker is installed, the service is available and permissions are configured, run:

docker run hello-world

If the image is missing locally, this command pulls it, creates a container, runs the example program and exits. It checks a basic container launch; it is not a long-running service. The official example describes this test.

The step from image to container creates an actual run, rather than downloading another recipe.

Chapter 4: Keep a record of the preparation↗

Building and running are different stages: Dockerfile → build → image → run → container. Changing a Dockerfile requires a new image build; existing containers do not automatically become the new version.

A recipe alone does not ensure reproducibility. An image tag can be updated to refer to different content, and dependencies downloaded during a build can change. Pinning dependencies and recording image digests help identify the environment actually used. The official build guidance explains mutable tags and digest pinning.

Fixing the image reduces environmental variation; inputs, configuration and the program’s own behavior still need separate control. Prepared food reduces uncertainty without making cooking conditions disappear.

Chapter 5: Keep the kitchen in order↗

Once a container starts, distinguish a running process from a working application. docker ps -a lists containers, including those that have stopped; docker logs reads application logs. These commands provide clues rather than replace application checks.

A container’s lifecycle is also different from its data’s lifecycle. Files in its writable layer disappear when the container is removed. Results that must persist can be written to appropriately mounted storage, such as a volume. Stopping and removing a container are different operations. Before replacing the lunch box, decide what must be kept elsewhere.

Chapter 6: Docker Compose and the container orchestra↗

When an application needs a frontend, backend and database, Docker Compose describes services and their network and storage relationships in YAML, then manages their lifecycles together. A common entry point is docker compose up.

A service can have one or more container instances, so “service” and “container” are not permanent one-to-one equivalents. Compose makes the arrangement explicit; whether the parts work together still depends on compatible applications and correct configuration. A conductor can organize the orchestra without playing every instrument.