INTRODUCTION TO CONTAINERS
Container is an isolated, resource controlled and portable environment.
It contains
- OS
- Application/software you developed
- Dependencies to run the application
- Environment variables
Microsoft offers two different types of windows containers
- Windows Server Container based on the windows server core image
- Hyper-V container based on the windows nano server image
- They are run by highly optimized VM, so the provide a full secure isolation
- Kernel of the Hyper-V container host is not shared with other Hyper-V containers.
- Hyper-V containers are managed by Docker.
- Booting Hyper-V containers takes longer than windows server container.
Lets understand the difference between the Containers and VMs.
Virtual Machines | Containers |
Maintained by Hypervisor | Maintained by Docker Engine |
Guest OS consume lot of HDs space/RAM | No guest OS |
VMs include the application, the necessary binaries and libraries and an entire guest OS –all of which can amount to tens of GBs | Containers include the application and all of its dependencies but share the kernel with other containers, running as isolated processes in user space on the OS. |
The below figure gives the good understanding about containers and VMs discussed above.
Some of the Container Jargons or terms are important to understand before we start using Containers.
- Container Host:Physical or Virtual computer system configured with the Windows Container feature.
- Container Image: A container image contains the base operating system, application, and all the application dependencies that are needed to quickly deploy a container.
- Container OS Image: The container OS image is the operating system environment.
- Container Registry: Container images are stored in a container registry, and can be downloaded on demand. It is a place where container images are published. A registry can be remote or on-premises. Eg: Docker Hub
- Docker Engine: It is the core of the Docker platform. It is a lightweight container runtime that builds and runs your container.
- Docker file: Docker files are used by developers to build and automate the creation of container images. With a Docker file, the Docker daemon can automatically build a container image.
In the next part we will install docker for windows and get our hands dirty with containerization.