1. Containerization with Docker
Let's continue with Chapter Two and start with containerization with Docker.
2. Recap: Definition of a container
To recap, containers provide an isolated environment in which to run an application. They contain everything needed for the application to run smoothly, such as source code, dependencies, and configurations.
3. Introducing Docker
Docker is the go-to choice for containerization and is open-source, meaning its code is freely available for anyone to use, modify, and distribute.
Docker has a large user base because it has revolutionized and standardized the way we use containers. According to Stack Overflow, Docker is one of the most used and popular tools out there!
4. Introducing Docker
Managing the lifecycle of containers, Docker is a software platform that provides tools for building, distributing, and running applications using containers.
5. Overview of Docker components
Here is a brief overview of important components of Docker's architecture! Let's go through each of them one by one!
6. Installing Docker via Docker Desktop
To get started with Docker, you'll want to install Docker Desktop. It's a desktop application available for Mac, Linux, and Windows. Docker Desktop provides a simple graphical user interface (also called a GUI) for managing your containers, applications, and images. It also includes the Docker Engine.
7. Client-server architecture of Docker Engine
The Docker Engine acts as a client-server application. Users can trigger Docker actions through the Docker Client. The most common way to do this is through the command line interface (also called the CLI). The CLI is the interface where we enter text commands for the computer to process. Certain commands can also be invoked through Docker Desktop. Client requests are received by the Docker Daemon.
8. Client-server architecture of Docker Engine
The Docker Daemon is the core service responsible for building, running, and managing Docker objects. It needs to be running whenever you're using Docker!
9. Overview of Docker objects
There are two main Docker objects: images and containers.
To build an image, you start by writing a text file called a Dockerfile. Like a recipe, it contains a series of instructions for building a container. You use the Dockerfile to build the blueprint for your container. This blueprint is called a Docker image.
Once you have a Docker image, you can use it to create a container. To make this clearer, here is an analogy:
Imagine a company that builds prefabricated houses, meaning every house is the same. Their Dockerfiles will be the blueprints for different houses. Their Docker images will be the different house models that a future homeowner can choose from. And their Docker container will be a constructed building based on a house model. Because this company builds many of the same houses, the same house models - the Docker images - are used multiple times to create multiple houses - multiple Docker containers.
10. Sharing containers via registries
Finally, Docker Registries are centralized locations for storing and managing container images. For example, Docker Hub is a popular public registry provided by Docker.
11. Let's practice!
Let's test your understanding of Docker!