from vms to containers: introducing docker containers for linux and windows server
TRANSCRIPT
![Page 1: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/1.jpg)
From VMs to Containers: Introducing Docker
Containers for Linux and Windows Server
Ido FlatowSenior Architect, Sela Group
Microsoft MVP & RDLevel: Intermediate
![Page 2: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/2.jpg)
The Problem• Shipping code to server
![Page 3: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/3.jpg)
The Matrix From Hell
![Page 4: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/4.jpg)
The Solution
![Page 5: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/5.jpg)
Docker Containers are NOT VMs• Easy connection to make• Fundamentally different architectures• Fundamentally different benefits
![Page 6: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/6.jpg)
VMs
![Page 7: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/7.jpg)
Containers
![Page 8: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/8.jpg)
Different, Not Mutually Exclusive
![Page 9: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/9.jpg)
Build, Ship, Run, Any App Anywhere
![Page 10: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/10.jpg)
Docker Concepts - Image• What is a container image?
– Analogous to an Exported Virtual Machine’s VHD and Config files– Templates for containers– Can depend on other images– Created by running a container and
capturing changesImage
MetadataName,
Creation Data,Command To Execute,
Dependences
Contents
Files Folders
ASP.NET Core Web Server
![Page 11: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/11.jpg)
Docker Concepts - Registry• https://hub.docker.com • Official Docker images from known vendors • Share and download Docker containers
from anywhere around the globe• Or… create your own trusted Docker
registry for your images
![Page 12: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/12.jpg)
Docker Concepts – Dockerfile• Definition of a containerFROM ubuntu:14.04RUN \ apt-get update && \ apt-get -y install apache2
COPY index.html /var/www/html/index.html
EXPOSE 80
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
![Page 13: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/13.jpg)
Basic Docker Commands$ docker pull # Download an image from a registry$ docker images # List all images on a Docker host$ docker build # Build an image from a Dockerfile $ docker run # Run an image $ docker commit # Create an image from a container$ docker ps # List all running and stopped instances $ docker stop # Stop a running instances $ docker rm # Remove an instance $ docker rmi # Remove an image
![Page 14: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/14.jpg)
BASIC WEB APPDEMO
![Page 15: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/15.jpg)
OK, LET’S TALK ABOUT WINDOWS CONTAINERS
What About Windows Containers?
![Page 16: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/16.jpg)
Windows Containers vs. Hyper V Containers• Windows containers
– Native Windows containers
– Powered by Docker Engine
• Hyper V containers – Windows containers +
kernel isolationInfrastracture
Windows Server 2016
Docker Engine
Bins/Libs
App Bins/Libs
App
WS KernelBins/Libs
App
Windows containers
Hyper V containers
![Page 17: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/17.jpg)
Dockerfile for Windows FROM windowsservercore
# Uses dism.exe to install the IIS roleRUN dism.exe /online /enable-feature /all /featurename:iis-webserver /NoRestart
# Creates an html file and add content to this fileRUN echo "Hello World - Dockerfile" > c:\inetpub\wwwroot\index.html
# Open cmd when the container runs from the new imageCMD [ "cmd" ]
![Page 18: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/18.jpg)
WINDOWS AND DOCKERDEMO
![Page 19: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/19.jpg)
Docker, From Dev to Production• Dev
– The developer knows best what his server needs– No more “But It works my laptop” in a middle of a major deployment
• Test– Spin a full testing environment on any server in just a few clicks
• Ops– Ops don’t need to deal with the internal server configuration– Free to manage the cluster’s health and scaling
• Production– Manage your production in the most flexible way – Scale in milliseconds– Work in sync on multiple clouds
![Page 20: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/20.jpg)
Full CI/CD with Docker
![Page 21: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/21.jpg)
DOCKER HUB WITH GITHUB
DEMO
![Page 22: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/22.jpg)
Docker File System• Logical file system by grouping FS primitives into
branches (directories, file systems, snapshots)• Each branch represents a layer in a Docker image• Images can be constructed / deconstructed as
needed (vs. a huge monolithic image in VMs)• When a container is started, a writeable layer is
added to the “top” of the file system
![Page 23: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/23.jpg)
Container Layers
![Page 24: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/24.jpg)
Docker Concepts - Volume• Volumes provide data persistency• Map a volume to a directory in the container• Volumes persist after the container is deleted• Can be created in a Dockerfile, or via CLI• Can map to an existing directory on the host• Use volumes to share data between containers
![Page 25: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/25.jpg)
DATA PERSISTENCYDEMO
![Page 26: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/26.jpg)
Container Mgmt. With Mesos• Apache Mesos: cluster manager for running
applications on a scalable cluster of servers• Marathon: task runner framework for Mesos
that is designed to launch long-running applications
• Makes it easier to deploy and manage applications in large-scale clustered environments:• High-Availability • Node Constraints• Application Health Checks• API & Service Discovery
![Page 27: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/27.jpg)
AZURE CONTAINER SERVICES
DEMO
![Page 28: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/28.jpg)
Getting Your Feet Wet• Stroll on the beach
– Setup your preferred Docker environment– Fire up some prebuilt images (nginx, hello-world)
• Take a swim– Pick a well documented solution, such as Wordpress– Build it for yourself (maybe you have a flower shop?)
• Dive in– Dockerize an existing project– Build your own Dockerfiles– Experiment with Docker Compose and Docker clusters
![Page 29: From VMs to Containers: Introducing Docker Containers for Linux and Windows Server](https://reader034.vdocuments.net/reader034/viewer/2022052405/586f72db1a28ab10258b5549/html5/thumbnails/29.jpg)
Resources• Know your Docker
– http://training.docker.com – http://docs.docker.com/userguide
• Docker on Windows Server 2016– https://blog.docker.com/2016/09/dockerforws2016/
• Docker on Azure (IaaS and PaaS)– https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-lin
ux-containers/– https://azure.microsoft.com/en-us/services/container-service/
• My Info– @IdoFlatow // [email protected] // http://www.idoflatow.net/downloads