Before looking deeper into WordPress and Docker together we have to understand Docker and how it works. Understanding Docker in deeper detail means that we can really get to know it and appreciate what it’s doing behind the scenes.
In Docker concepts part 1, we will look at Daemons, Images, Containers and Registries. In part 2, we will look at Volumes, Networks and Ports (coming soon).
What is Docker?
Docker is a computer program designed to run isolated, in portable containers, created from images that streamlines development, operations and application management for software teams.
Not seen the rest of our series? Click to find parts 1, 2, and 3
Docker Concepts
The Docker Daemon
Docker is just a computer program, but in comes in a few parts. The Daemon is just like a daemon in any other context.
A Daemon is a service that waits for instructions and carries out tasks on your computer. It’s often used with any number of user interfaces.
Docker’s daemon UI includes:
- The Docker CLI
- The Docker GUI apps
- Other Docker ecosystem tools (like Docker Compose)
- 3rd party container orchestration tools like Kubernetes
- The Docker Engine REST API
The daemon is the core process that needs to run for Docker to work. It controls the running containers and processes requests made to all docker services.
Docker Containers
The daemon is useless without something to run. For Docker, daemon runs the container, and the containers are created from images.
Containers can be started, stopped, paused, moved and deleted. Their versatility is a useful tool for developers Think of the container as a running VM, created from the Image provided.
The joy of Docker’s containers is that they can effectively run as an independent computer that can be controlled. You can even SSH (secure shell) in and make changes.
The containers are isolated from each other. This means they can’t really interfere with each other, therefore, reducing risk significantly.
Better yet, containers are temporary and come and go. If something changes in a container, it will not be persisted unless saved to permanent storage.
Docker Images
An image is what a container is created from. It is “built” from a series of instructions in a DockerFile.
An image can have several instances running simultaneously as separate containers. Two container with the same image will be identical, until files are mounted inside of them.
Images can be versioned, too. So you can run version 1 of an image and version 1.1 of the same image should you need specific versions.
Images are portable and can be shipped between computers, servers, providers and use cases. Images can serve as the basis for a custom image by including it from the DockerFile of your custom image(s).
Docker Registries
A registry is a way of sharing docker images. Think of it as a GitHub repository but for Docker images.
Public and private registries are available, depending on your needs. Images can be pulled from the registry or you can push changes to your images.
Additionally, you can push changes to private repositories to make them available to other services and deployment tools.
What to expect from part 2
In the second part of Docker concepts, we will cover ports, volumes, and networking.