Docker Fundamentals
Fundamental concepts about Docker. The Github repo could be found here.
What is Docker?
What is a Container?
- A way to package application with all the necessary dependencies and configurations
- Portable artifact, easily shared and moved around
- Makes development and deployment more efficient.
- Layers of images
- Mostly Linux Base Image, bc small in size
- Application image on top
Containers live in container repositories:
- Private repositories
- Public repository for Docker (e.g: DockerHub)
Before vs After Containers
Before Containers
- Installation process different on each OS environment
- Many steps where something could go wrong
- Configuration on server needed: Dependency version conflicts
- Textual guide of deployment: Misunderstandings
After Containers
- Own isolated environment (based on lightweight linux)
- Packaged with all needed configuration
- One command to install the app
- Run same app with 2 different versions
- Developers and Operations work together to package the application in a container
- No environmental configuration needed on server (except Docker Runtime)
Docker Image vs Container:
- Image:
- The actual package
- Artifact, that can be moved around
- Container:
- Actually start the application
- Container environment is created
Docker vs Virtual Machine
The difference lies on what parts of the operating system they virtualize:
- Docker virtualizes the Applications layer
- Virtual Machines virtualizes the OS Kernel and the Applications layer
This means:
- Size: The size of Docker images are much smaller (couple of MB)
- Speed: Docker containers start and run much fast
- Compatibility: VM of any OS can run on any OS host — Docker can’t do this, a workaround is installing a technology called Docker Toolbox which abstracts away the Kernel
What is Docker?
Docker is a set of platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers. - Wikipedia
From the above definition, basically, Docker consists of three things:
- A set of Platform as a Service (PaaS)
- Docker uses OS-level virtualization
- For delivery of software in packages called containers
Docker Architecture: