My Notes Based on Ajeet Raina's Lecture
Historical Context of Application Architecture Transformations
Around the year 2000, we dealt with monolithic applications. These were typically built on .NET or Java, where deployment was done on a single server.
How It Is Now
Applications are deployed continuously. Newer versions of certain parts of the application are deployed more frequently. Applications are built from loosely coupled components. A component is also called a service, also known as a microservice. Docker can be deployed across multiple servers.
Application architecture and components are more distributed. This introduces a certain dependency. If you have a distributed, complex stack that operates on a more complex hardware stack.
Ajeet provides an analogy, saying that the logistics industry solved this problem long ago—deciding what, where, and how things should be packed and shipped to the destination.
Docker introduces standardization in the way applications are deployed.
What is Docker?
According to Ajeet, Docker is something between a Virtualization tool and a Configuration Manager. Docker is between Manual Configuration and Traditional VMs.
What is Docker?
-
It's both a company and a product.
-
Docker was developed by DotCloud Inc. (now Docker Inc.).
-
It's a framework on which they built PaaS at DotCloud Inc.
-
A user-friendly environment for system admins and developers.
-
Developers focus on building applications and running them inside containers.
-
System admins focus on running containers with the application.
-
It can be configured on Windows, OSX, and Linux and works the same way.
-
It guarantees the same behavior—if you build the same container on another computer, you expect the same behavior.
-
It's a tool capable of packaging an application and all necessary dependencies into a virtual container.
-
A handy container implementation.
-
Docker uses the operating system's kernel. All containers run on the machine using the same kernel.
-
Docker can isolate resources using cgroups and kernel namespaces.
Docker Containers Are Not Virtual Machines
-
Docker is not like a VM.
-
Docker uses the host operating system's kernel.
-
Docker cannot boot another operating system.
-
You can't have your own modules.
-
It doesn’t need to initialize as PID 1.
-
It doesn't need syslogd or cron.
Similarities Between Docker and VM
VM | docker |
---|---|
A process in one VM doesn’t see the process in another VM | A process in one container doesn’t see processes in another container |
Each VM has its own core filesystem | Each container has its own core filesystem |
A VM is a running instance from a .VMX or .VMDK file | Docker containers are a running instance from a Docker image |
Host OS can be different from guest OS | Host OS can be different from container OS |
Differences Between Docker and VM
VM | docker |
---|---|
Each VM runs its own operating system | All containers share the same system kernel |
Booting a system takes minutes | Container initialization takes seconds |
Snapshots are used sporadically in VMs | Images are built incrementally, layer by layer |
No version control. No distinction between versions | Images can be version-controlled. Docker Hub works like GitHub |
Multiple VMs cannot run simultaneously on one laptop | Multiple containers can run on one laptop |
Only one virtual machine can run from a single .VMX or .VMDK file | Multiple containers can be launched from one image |
Docker Terminology
Docker Image - the foundation of a Docker container. Represents the entire application.
Docker Container - the basic unit in which application services reside and execute.
Docker Engine - creates, deploys, and runs Docker containers.
Registry Service (Docker Hub) - a cloud or server-based service for storing and distributing images.
Basic Commands
To download a Docker image:
docker pull perfringis/my_image
To list Docker images:
docker image ls
To run a container:
docker container run -d -p 5000:5000 --name container_name perfringis/my_image
To stop a running container:
docker container stop container_name
Source
The notes were created based on the recording: Recording