DEV Community

Cover image for Super-Duper Docker
Muhammad Antar
Muhammad Antar

Posted on

Super-Duper Docker

1- What’s Docker?

  • Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications.

This definition will take us to an important definition called Containerization: Containerization is the packaging together of software code with all it’s necessary components like libraries, frameworks, and other dependencies so that they are isolated in their own “ Container “ .

Now we will move into an important question, what’s the difference between Containers and Virtualization?

2- What’s the difference between Containers and Virtual Machines?

If we checked the photo attached we will see that

  • Containers: Containers create lightweight, isolated logical namespaces on the underlying operating system, usually within the Linux kernel. Popular Container runtimes commonly used in software engineering are Docker and LXC. Every container has its specific network stack and its own process space, including all of the underlying dependencies required to run the application or service.
    The contents of a container are held in a binary file. Containers run independently from the operating system and other containers running on the system. Since they don’t contain the entire operating system, containers are very lightweight. Containers are a small computing unit, allowing a single operating system to run hundreds or even thousands of containers.

  • Virtual Machines: A Virtual Machine (VM) contains and runs a complete operating system on the underlying virtualized hardware resource. Popular Virtual Machine providers or Hypervisors are Citrix, VMWare, and Hyper-V.
    These virtualized hardware resources are created and managed by the Hypervisor. Type 1 Hypervisors run directly on the host machine hardware, while Type 2 Hypervisors run on top of the host machine’s operating system. Each Virtual Machine is an image of a complete operating system, so it tends to be a much larger computing unit, usually a couple of gigabytes.

3- 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.
A- The Docker daemon: The Docker daemon (dockerd) listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes.

B- The Docker client: The Docker client (docker) is the primary way that many Docker users interact with Docker.

C- Docker Desktop: Docker Desktop is an easy-to-install application for your Mac or Windows environment that enables you to build and share containerized applications and micro services.

D- 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.

4- NameSpaces:

Docker uses a technology called namespaces to provide the isolated workspace called the container. When you run a container, Docker creates a set of namespaces for that container.
These namespaces provide a layer of isolation. Each aspect of a container runs in a separate namespace and its access is limited to that namespace.

Top comments (1)

Collapse
 
andrewbaisden profile image
Andrew Baisden

Never expected to use so much Docker coming from a frontend developer background but its now a tool i'm using daily at work.