Deciphering Docker Installation Components
When installing “Docker”, you install multiple components, see bolding:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Docker Client: It is the main interface through which users interact with Docker. Installed as a part of Docker, it facilitates the connection and communication from your local machine to the Docker daemon, either locally or remotely. When a Docker command runs, it sends a request to Docker API which then communicates with Docker daemon to execute the command. Being able to communicate with multiple hosts, it ensures versatility in terms of controlling and managing different Docker installations.
Docker Image: These are lightweight, stand-alone, and executable software packages that include everything needed to run it: code, runtime, system tools, system libraries, and settings. The Docker image is built up from a set of read-only layers, each of which represents a Dockerfile instruction. Each layer is only a set of differences from the layer before it. They serve as the building blocks of your Docker environment and are used to construct Docker containers. When a Docker image is downloaded and installed via the Docker pull command, it pulls down necessary image layers which are not locally available and assembles the Docker container.
Docker Daemon: Docker daemon is a background service running on the host that manages building, running and distributing Docker containers. It is the part of Docker installation which does the heavy lifting of building, running, and managing containers. Docker daemon runs and listens to requests Docker API sends, executing a range of functions including managing Docker objects. It can communicate with other daemons to manage Docker services.
Docker Networking: Docker Networking is a programmable, software-defined mechanism for linking Docker containers together, allowing them to communicate and share data. The installation comes with five network drivers or plugins to facilitate networking:
Bridge: This is a private network created in the host all your Docker containers attach to. By default if you don’t tell Docker to use a specific network, it will use the Bridge network.
Host: This driver removes network isolation between the docker host and the docker containers to use the host's networking directly.
None: This driver disables all networking.
Overlay: This network enables swarm services to communicate with each other.
Macvlan: Macvlan networks allow the Docker containers to appear as physical devices at the network level, allowing for seamless integration with existing networking equipment and software configurations.
Docker Volumes: Docker volumes are the preferred method for handling persistent data created by and used by Docker containers. It's a specially-designated directory within one or more containers that bypasses the Union File System. Volumes provide several advantages over bind mounts:
Volumes are persistent, existing beyond the life of a container.
Volumes can be safely shared and reused among containers.
Volume changes can be more readily managed.
Docker manages volumes and the files that they contain.
Volumes work on both Windows and Linux containers.
Volumes can be more safely backed up or migrated.
Every Docker installation automatically includes these components. Understanding the roles that each plays will give you a better grasp of Docker as a whole and help you utilize Docker effectively.
Think about Docker as a container suite, and less of only a container engine.