Getting started with Docker and ASP.NET Core. Slides goes through history of containers, docker concepts and architecture, use cases, best practices and workflows
2. ABOUT ME
Full stack web developer in Microsoft
technology stack
10+ years of experience
Microsoft MVP
Technical Analyst@ UST Global
Blogger@ www.techrepository.in
Contact me @amaldevv
12. WHAT IS
DOCKER ?
Docker is an open-source engine that automates the
deployment of any application as a lightweight,
portable, self-sufficient container that will run virtually
anywhere.
Source : docker.io
15. IMAGES &
CONTAINERS
IMAGES
Immutable file
Snapshot of the container
Stored in Docker Hub/Private
Registry
CONTAINERS
Based on images
Contains everything needed
to run the application
Isolated application platform
20. BEST
PRACTICES
Don’t store data inside containers
Don’t deploy applications into running containers
Avoid creating larger images
Try to avoid creating single layer images
Avoid creating images from running containers
Avoid hard coding of IPAddresses
Don’t store credentials in the image
Avoid running more than one process inside the container
Exclude files using .dockerignore file
Avoid installing unnecessary packages
One application installed on one physical server
Cons
Significant downtime needed for upgrading the application or maintenance
Cost factor is on the higher side
Lot of resources were wasted since most of them is in idle state for a considerable amount of time
It’s very difficult to migrate or scale up/down and time consuming too
Vendor lock-in
Virtualization disrupted this
Allowed to host multiple applications on a physical server
Each application was running inside a VM, which has got its own OS.
OS can be same as the host OS or can be a different one
Pros
Virtualization disrupted this
Allowed to host multiple applications on a physical server
Each application was running inside a VM, which has got its own OS.
OS can be same as the host OS or can be a different one
Pros
Again guest OS means resources is wasted
Is an OS level virtualization method
Method for deploying and running application without launching an entire VM for each
They run on single control host and share a single kernel
Each container will have its own root file system, processes, memory and network ports
Containers runs as an isolated process, but shares OS and where appropriate Bins/Libraries
Significantly faster development, less overhead, easy to migrate, faster restarts
Containers are lightweight
Guest OS is shared by all containers
Meaning less CPU, RAM and storage
Can create more containers with the same resources
It’s a platform for developing, shipping and running applications using container virtualization technology.
Provides the ability to package and run application in a container
Uses client-server architecture
Client takes the input from the user and sends to the daemon which is responsible for building, running and distributing the containers
Client and Daemon can run on same system, or can connect a client to remote daemon using a REST API
Docker Host
Client
Is in the form of docker binary.
Is the primary user interface.
Accepts commands from the user and communicates with the daemon
Registry
Stores the docker images
Two types of registry are there, public and private
Docker Hub is a public registry
If image is a class then container is the instance of the class
https://github.com/wsargent/docker-cheat-sheet
docker pull
daemon will search for the image in the local cache
If not found then it will search for it in the registry and downloads to the local cache
Docker run
Will create the container based on this image and executes the application