Home Docker
Post
Cancel

Docker

Docker is a program developed using Go Lang(systems Language) which manages the kernel of your machine to create and maintain container infra structure

This post mainly covers the docker as a program, before going through this learn about docker architecture(images, containers) and what is docker.

Kernel: Kernel is a decor over your machine which recives signals from your hardware. It makes the process to run, schedule them and what ever instruction you give by your program or your UI actions sends signals to kernel to execute.

Under the hook

Docker as a program handles and maintain the following by interacting with the kernel

  • Processes(Using Cgroups of the kernel) : It groups together the processors and isolates from other process to create a isolated world of containers.
  • Networking(Using Namespaces) : Using the namespaces docker creates the virtual bridges betweeen containers(group of processes) to communicate between the containers attached to bridges.
  • File System(Save-on-write) : It saves the images and anything changes made on containers can be committed to new images. Any changes on the container can be made with out effecting the image file. You can look image as an executable file. Storage and shared spaces also maintained.

Process

  • Process is always a parent-child relation. When a child process exits it returns the exit code to the parent process. Different parallel process run together. Each process takes a RAM, execution(CPU) etc.
  • Container is a init process which(Process Zero) is the main process of the containers. When your parent process exits container stops and no other child process runs. Mostly, process runs shell and from this shell other commands(child process runs)

Networking

Docker manages the networking for you. Netwroking is divided into different layers.

  • Ethernet Layer this is mainly the local network where containers of same network communicate with each other through virtual bridges that are connected to.
  • Next comes the IP protocol layer where actually packets move between programs of different networks. Routing is how packets gets into and out of noetworks.
  • Ports are nothing but specific programs on your computer listens to traffic.

Docker create a virtual private networks using the virtual bridges. When you create a network it creates a bridge(a software switches). These bridges control the ethernet layer.

This post is licensed under CC BY 4.0 by the author.

Open SSL Encryption

Asynchronous Programming

Comments powered by Disqus.