Overview
Docker is an open-source platform for developing, deploying, and distributing containerized software.
Images and Containers
The two primary Docker entities are images and containers. Images provide application executable and file system information and may be distributed through registries, which are services that hosts and provide images. These images are defined via Dockerfiles, consisting of sequential build instructions. Relatedly, containers are running instances of images. These container processes are isolated from each other and may be started, stopped, moved, or deleted via the Docker CLI. Any data within a container’s private file system that is not written to persistent storage will be lost upon deleting the container.
Building and Running Containers
docker build . -t techsquawks/hello-world
docker run -t techsquawks/hello-world
FROM alpine:3.14
ENTRYPOINT [ "echo", "hello world!" ]
hello world!
The first l0
++010+
.ne of the Dockerfile defines the base image to use when building the image. In this case, alpine
is leveraged due to its minimal image size. The second line defines the container entrypoint, or the underlying command that will be executed upon running the container.
Docker containers are executed and maintained by the Docker host, which can be accessed via the Docker API or, more preferably, the Docker CLI. docker build
prompts the Docker engine to build the image from the local Dockerfile and tag the image with techsquawks/hello-world
so the build may be readily referenced. Likewise, docker run
executes the resulting image, with the executable program and arguments determined by the Dockerfile ENTRYPOINT
line.
Architecture
Docker broadly consists of three components, the Docker client, Docker Host, and Docker Hub. The Docker client is used to interact the Docker engine and invoke certain actions. The docker engine builds images and manages containers. Lastly, Docker Hub is an image registry, and is used to distribute images for both public and private use cases.

Figure 1: The three primary Docker components, the Docker Client, Docker Host, and Docker Hub. The Docker Host manages containers and images on a particular machine, the Docker Client invokes certain Docker operations, and the images may be distributed (pushed and pulled) from Docker Hub.