Slides describing technical details on Docker containers, containers under-the-hood, Windows & Linux containers, differences between containers and VM, and how to get started with Docker Container. Ideal for beginners
4. Containers Overview
● Application packaging format for packaging apps with basic minimum OS
libraries (image) related to Linux or Windows
● Two types of containers
○ Linux/Windows Containers: Runs in user mode and share host OS kernel; Linux containers run
on Linux host OS, Windows containers run on Windows host OS
○ Hyper-V Containers: On Windows, Windows/Linux containers run inside stripped down Hyper-
V VM having respective lightweight Windows/Linux kernel
● Isolate apps from each other
● Linux containers (Debian, Ubuntu, fedora, CentOS, RHEL, Alpine); Windows
containers (windowsservercore, nanoserver)
7. Docker Containers vs VMs (Contd.)
Virtual Machines
● VMs are Guest OS
● Requires Hypervisor
● Isolate systems
● Takes lot of disk space for
GuestOS
● Starts in minutes
Docker Containers
● Linux/Windows Containers share
underlying machine’s OS system
kernel
● Hyper-V Containers run within
lightweight VM
● Requires Container Runtime
● Isolate applications
● Lot of disk space and resources are
saved.
● Starts in milliseconds
12. What are Containers?
● Images are built as softwares and
custom app code packaged as reusable
read-only layers.
● Containers are image added with a
read-writable layer on top and run on
top of docker engine.
● Creating a container means creating a
read-write layer on top of the image.
● All files added/modified as part of
container is added on to this read-write
layer
● Deleting a container is removing read-
write layer.
13. Containers vis-a-vis Images
● Two different images with different app
versions; Would require change in the
Dockerfile
● Layers within images are reusable. Two
separate images could reuse some of the layers
● Containers created/started using different
images end up reusing one or more layers apart
from unique layers related to different images
Imagine how useful this could
be for testing purpose.
14. Containers vis-a-vis Images (Contd.)
● Two different images with different Java
versions; Would require change in the
Dockerfile
● Containers created/started using different
images end up reusing one or more layers apart
from unique layers related to different images
Imagine how useful this could
be for testing purpose.
15. Containers Engine Overview
● Enables containerized
applications to run anywhere
consistently on any infrastructure
● Available for Windows and
Linux (Ubuntu, CentOS, Oracle
Linux, RHEL, SUSE, Debian,
Fedora)
● Container runtime - Containerd
(Open source container runtime
project)
Containers Images need Container Engine (Docker Engine) to run as
Containers
17. Why Containers?
● Build Portable Apps: Helps in building portable apps owing to container
runtime engine; High portability helps app run anywhere; This is like a Java
program which could run in any environment given Java runtime.
● Build Cloud-native Apps: Helps package app such as app could easily be
moved from one cloud platform to other without much of an issue.
● Enables DevOps: Helps achieve DevOps goals by having Ops team
containerize the apps, and later run continuous testing, and continuous
delivery to different environments; Shorten the lead time to production
18. Why Containers? (Contd.)
● Enhanced Speed in setting up Dev & test Environments
● Enhanced Efficiency owing to less OS overhead and effective resource usage
● Enhance Developers/Test Engineers Productivity: Developers and Test
Engineers could quickly test their changes in production like environment
without having to wait for their workload to move through different
environments.
● Enable Quick Client Demonstration: Allows to commission/decommission
app of specific version and give demo to client stakeholders.
20. Containers Dev/Testing Use Cases
● Helps achieve parity between Dev, Test and Production environments
● Commission / Decommission Dev/test environments on-demand and run
automated tests:
○ Dev/Test apps of different versions
○ Dev/Test app with different versions of softwares
● When integrated with build automation tools such as Jenkins, most up-to-
date test environments (similar to prod) could be created afresh on remote
servers and run automated tests
23. Containers Orchestration & Testing
● Examples include Docker Swarm,
Kubernetes
● Recreate test container instances on
different test nodes using new images
built as part of build jobs
● Helps in setting up automated Canary,
A/B testing using rolling updates
strategy.
● Distributed load testing using container
orchestration tool
○ Rapid scaling of test clients for
creating load testing traffic; Elastic
cloud infrastructure becomes key
27. Docker Useful Commands
● Commands
○ docker pull; docker push (Pull or push an image from/to image registry such as DockerHub)
○ docker build (Building docker images)
○ docker run (Run a command in a new container)
○ docker start; docker stop (Start and stop the containers)
○ docker ps; docker ps -a (displays containers)
○ docker images (displays images)
○ docker rm (Removes a container)
○ docker rmi; docker rmi -f (Removes an image)
○ docker search (Search the image in the registry)
● URLs
○ https://docs.docker.com/engine/reference/commandline/docker/
28. References
● Windows server 2016 getting Linux Containers
(https://redmondmag.com/articles/2017/04/20/windows-server-2016-getting-
linux-containers.aspx)
● When to use VM or Containers (https://blog.docker.com/2016/05/vm-or-
containers/)
● Deep dive into windows server containers (https://xebia.com/blog/deep-dive-
into-windows-server-containers-and-docker-part-2-underlying-implementation-
of-windows-server-containers/)