What is Docker: a brief history and basic abstractions

On August 10, a video course on Docker started in Slurm , in which we analyze it in full - from basic abstractions to network parameters.



In this article, we'll talk about the history of Docker and its main abstractions: Image, Cli, Dockerfile. The lecture is designed for beginners, so it is unlikely to be of interest to experienced users. There will be no blood, no appendix and no deep diving. The very basics.





What is Docker



Let's take a look at the definition of Docker from Wikipedia.



Docker is software for automating the deployment and management of applications in containerized environments.

Nothing is clear from this definition. It is especially unclear what "containerization-enabled environments" mean. To understand, let's go back to the past. Let's start with the era that I conventionally call the "Monolithic era".



Monolithic era



โ€” 2000-, , . . , . :





Pets โ€” . , , , . : , .





: VMware, VirtualBox, Hyper-V, Qemu KVM . . , . , . โ€” . โ€” , , Nginx, Apache, MySQL. , . , . , .





OpenVZ, Systemd-nspawn, LXC. โ€” LXC (Linux Containers).



LXC โ€” Linux . LXC , .



LXC . ?





: , . - , .



.

, .





ยซยป โ€” , - . , .



, , . , Container Engine, . , , .







, , โ€” Namespaces Control Groups.



Namespaces: PID, Networking, Mount User. , .



PID Namespace . , , PID Namespace, , PID 1. PID 1 โ€” systemd init. , namespace, PID 1.



Networking Namespace / . Mount โ€” . User โ€” .



Control Groups: Memory, CPU, IOPS, Network โ€” 12 . Cgroups (ยซC-ยป).



Control Groups . Control Groups , - .



, : Capabilities, Copy-on-write .



Capabilities โ€” , , . . , root , . : capabilities Time Capsule, . , .



Copy-on-write Docker, .



Docker Cgroups v2, Cgroups v1.

.



, . , :



  • : OpenVZ , , , ;
  • , . , , . .


, .





, :



  • โ€” .
  • . .
  • , โ€” , .
  • .


, pets vs cattle? , cattle โ€” . โ€” . 100 , 100 . - 2-3 . . : , . .



2014-2015 Docker โ€” , .



Docker . Docker , , , .



Docker- , . Docker . , : , , . Docker . Docker- , , .







. - , Docker , Linux , . , ยซ , Docker โ€” , Linux ยป.



, , Docker , , .



โ€” PID namespace. namespace - , PID 1. PID, namespace, . , Nginx, PID 1 (-). PID 12623. , .



โ€” Cgroups. Cgroups , . , memory accounting: , , . , , , . , , Docker, .



. . , . Docker - , , , , , . - nf_conntrack, .


Docker



Docker :



  1. Docker Daemon โ€” Container Engine; .
  2. Docker CLI โ€” Docker.
  3. Dockerfile โ€” , .
  4. Image โ€” , .
  5. Container.
  6. Docker registry โ€” .


:





Docker_host Docker daemon, . Client, : , , . Docker daemon registry . Docker- ( -), TCP .



.



Docker daemon () โ€” , -: , , . ยซ ยป, .



Docker CLI โ€” Docker, . , , .



:



docker ps โ€” , Docker-.

docker images โ€” , .

docker search <> โ€” registry.

docker pull <> โ€” registry .

docker build <</path/to/dir>> โ€” .

docker run <> โ€” .

docker rm <> โ€” .

docker logs <> โ€”

docker start/stop/restart <> โ€”

, , 70% Docker .



Dockerfile โ€” . โ€” . .





Dockerfile: , โ€” . , ( Dockerfile), Image.



, , . : ยซ ยป โ€” . ยซ ยป โ€” , . . Dockerfile - โ€” "python" "main.py", - , โ€” , .



Image โ€” , . Docker ( deb rpm-), image โ€” rpm-. yum install , , , . : , Docker registry ( yum, ), image SHA-256, .



Image Dockerfile. Dockerfile . .



Docker registry โ€” Docker. , Docker โ€” dockerhub. , Docker registry.



Container โ€” , . Dockerfile , . , . โ€” . , , Docker.



ยซ โ€” ยป PID Namespace. Namespace PID 1, , . : , , . Best Practices, .



: ยซ Dockerยป.



: , Kubernetes, Southbridge, .




All Articles