Docker - Complete Beginner’s guide.

In this blog, you will learn what Docker is, what are Docker's most important components, and architecture of docker.

Docker - Complete Beginner’s guide.

What is Docker?

  • Docker is an open secure platform for developing, shipping, and running applications.
  • Docker runs on Mac or Windows Development machines(with a virtual machine) .
  • Docker relies on Images and Containers.

Let's understand what is Docker Images and Docker Containers and how they are relate to each other.

What is Docker Image?

  • An image is a read-only template with instructions for creating a Docker container.
  • Docker Image is a template that contains the application, and all the dependencies required to run that application on Docker.
  • Docker image is like blue print for creating Docker container instances.

What is Docker Container?

  • A container is a runnable instance of an image.
  • You can create, start, stop, move, or delete a container using the Docker API or CLI.
  • You can connect a container to one or more networks, attach storage to it, or even create a new image based on its current state.
  • By default, a container is relatively well isolated from other containers and its host machine. You can control how isolated a container’s network, storage, or other underlying subsystems are from other containers or from the host machine.

    In simple terms - An isolated and secured shipping container created from an image that can be run , start , stop , move and delete.

Docker architecture

Docker uses a client-server architecture. The Docker client talks to the Docker daemon, which does the heavy lifting of building, running, and distributing your Docker containers. The Docker client and daemon can run on the same system, or you can connect a Docker client to a remote Docker daemon. The Docker client and daemon communicate using a REST API, over UNIX sockets or a network interface. Another Docker client is Docker Compose, that lets you work with applications consisting of a set of containers.

daa.jpg

The Docker client

  • The Docker client is the primary way to interact with Docker.
  • When you use commands such as docker run, the client sends these commands to dockerd, which carries them out. The docker command uses the Docker API.
  • The Docker client can communicate with more than one daemon.

The Docker daemon

  • The Docker daemon (dockerd) listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes.
  • A daemon can also communicate with other daemons to manage Docker services.

Docker registries

  • A Docker registry stores Docker images.
  • Docker Hub is a public registry that anyone can use, and Docker is configured to look for images on Docker Hub by default. You can even run your own private registry.

When you use the docker pull or docker run commands, the required images are pulled from your configured registry. When you use the docker push command, your image is pushed to your configured registry.

Where does Docker Run?

  • Linux
  • Windows

Benefits of Docker

  • Accelerate Developer Onboarding
  • Eliminate app conflicts
  • Environment consistency
  • Ship software faster

Docker Tool - Docker Desktop( Window 10 pro+ or Mac )

  • Docker Desktop is an easy to install application for your Mac or Windows environment that enables you to build and share containerized applications.
  • Docker Desktop includes Docker Engine, Docker CLI client, Docker Compose, Docker Content Trust, Kubernetes, and Credential Helper.

Click on link to install Docker Desktop Install Docker Desktop

Conclusion

Developing an application is a challenge, and making sure that it works in every environment is an even bigger milestone. Docker containers solve this issue by giving developers a way to port software easily.