A Hands on Introduction to Docker

Similar documents
Travis Cardwell Technical Meeting

Deployment Patterns using Docker and Chef

Who is Docker and how he can help us? Heino Talvik

Arup Nanda VP, Data Services Priceline.com

Docker 101 Workshop. Eric Smalling - Solution Architect, Docker

IBM Bluemix compute capabilities IBM Corporation

CNA1699BU Running Docker on your Existing Infrastructure with vsphere Integrated Containers Martijn Baecke Patrick Daigle VMworld 2017 Content: Not fo

Splunk N Box. Splunk Multi-Site Clusters In 20 Minutes or Less! Mohamad Hassan Sales Engineer. 9/25/2017 Washington, DC

The age of orchestration

VMworld 2017 Content: Not for publication #CNA1699BE CONFIDENTIAL 2

Introduction to Containers

Technical Manual. Software Quality Analysis as a Service (SQUAAD) Team No.1. Implementers: Aleksandr Chernousov Chris Harman Supicha Phadungslip

Lab 8: Building Microservices on Oracle Autonomous Transaction Processing Service

Getting Started With Containers

docker & HEP: containerization of applications for development, distribution and preservation

Table of Contents 1.1. Introduction. Overview of vsphere Integrated Containers 1.2

Container-based virtualization: Docker

/ Cloud Computing. Recitation 5 September 26 th, 2017

Table of Contents 1.1. Overview. Containers, Docker, Registries vsphere Integrated Containers Engine

Docker und IBM Digital Experience in Docker Container

Introduction to containers

Azure DevOps. Randy Pagels Intelligent Cloud Technical Specialist Great Lakes Region

/ Cloud Computing. Recitation 5 February 14th, 2017

UP! TO DOCKER PAAS. Ming

Think Small to Scale Big

Infrastructure at your Service. Oracle over Docker. Oracle over Docker

Network softwarization Lab session 2: OS Virtualization Networking

DevOps in the Cloud A pipeline to heaven?! Robert Cowham BCS CMSG Vice Chair

Cloud I - Introduction

/ Cloud Computing. Recitation 5 September 27 th, 2016

Docker II - Judgement Day

At Course Completion Prepares you as per certification requirements for AWS Developer Associate.

AWS Lambda. 1.1 What is AWS Lambda?

ovirt and Docker Integration

Building A Better Test Platform:

How to go serverless with AWS Lambda

Containers, Serverless and Functions in a nutshell. Eugene Fedorenko

Docker and Splunk Development

Harbor Registry. VMware VMware Inc. All rights reserved.

WHITE PAPER. RedHat OpenShift Container Platform. Benefits: Abstract. 1.1 Introduction

Developing and Testing Java Microservices on Docker. Todd Fasullo Dir. Engineering

Creating pipelines that build, test and deploy containerized artifacts Slides: Tom Adams

Installing and Using Docker Toolbox for Mac OSX and Windows

Docker at Lyft Speeding up development Matthew #dockercon

Follow me!

agenda PAE Docker Docker PAE

LSST software stack and deployment on other architectures. William O Mullane for Andy Connolly with material from Owen Boberg

Running Splunk Enterprise within Docker

What s Up Docker. Presented by Robert Sordillo Avada Software

S INSIDE NVIDIA GPU CLOUD DEEP LEARNING FRAMEWORK CONTAINERS

Using Docker in High Performance Computing in OpenPOWER Environment

Index. Bessel function, 51 Big data, 1. Cloud-based version-control system, 226 Containerization, 30 application, 32 virtualize processes, 30 31

64-bit ARM Unikernels on ukvm

DGX-1 DOCKER USER GUIDE Josh Park Senior Solutions Architect Contents created by Jack Han Solutions Architect

Important DevOps Technologies (3+2+3days) for Deployment

Cloud Computing II. Exercises

Bright Cluster Manager: Using the NVIDIA NGC Deep Learning Containers

A DEVOPS STATE OF MIND. Chris Van Tuin Chief Technologist, West

Running MarkLogic in Containers (Both Docker and Kubernetes)

Serverless Architecture Hochskalierbare Anwendungen ohne Server. Sascha Möllering, Solutions Architect

Develop and test your Mobile App faster on AWS

Docker A FRAMEWORK FOR DATA INTENSIVE COMPUTING

Con$nuous Deployment with Docker Andrew Aslinger. Oct

Kubernetes The Path to Cloud Native

AMD EPYC Delivers Linear Scalability for Docker with Bare-Metal Performance

Java Architectures A New Hope. Eberhard Wolff

Fixing the "It works on my machine!" Problem with Docker

DEPLOYMENT MADE EASY!

An introduction to Docker

Docker CaaS. Sandor Klein VP EMEA

Infoblox Kubernetes1.0.0 IPAM Plugin

SQL Server containers with in-container data

Docker Container Access Reference Design

Set up, Configure, and Use Docker on Local Dev Machine

Clocker. Deploying Complex Applica3ons on Docker using Apache Brooklyn

Introduction to virtualisation, hardware, cloud, containers, unikernels, microkernels. and everything else

INTRODUCTION TO NEXTFLOW

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Zenoss Resource Manager Upgrade Guide

Rethink Your Workstation Strategy with Amazon AppStream 2.0

INDIGO PAAS TUTORIAL. ! Marica Antonacci RIA INFN-Bari

AWS Integration Guide

Simplified CICD with Jenkins and Git on the ZeroStack Platform

AALOK INSTITUTE. DevOps Training

From the Beginning: Your First Node.js Web Service

Docker and Oracle Everything You Wanted To Know

Automating the Build Pipeline for Docker Container

Getting Started with Hadoop

SQL Server inside a docker container. Christophe LAPORTE SQL Server MVP/MCM SQL Saturday 735 Helsinki 2018

A DEVOPS STATE OF MIND WITH DOCKER AND KUBERNETES. Chris Van Tuin Chief Technologist, West

INDIGO-DataCloud Architectural Overview

CS-580K/480K Advanced Topics in Cloud Computing. Container III

Zenoss Core Upgrade Guide

EsgynDB Enterprise 2.0 Platform Reference Architecture

BUILDING A GPU-FOCUSED CI SOLUTION

containerization: more than the new virtualization

Docker for Developers

Zenoss Resource Manager Planning Guide

Get Started with SQL Server containers with cloned databases

Enhancing cloud applications by using messaging services IBM Corporation

Transcription:

A Hands on Introduction to Docker Len Bass A Hands on introduction Introduction to to Docker May 2017 1 4, Len 2017 Bass 2017 Len Bass 1

Setting expectations This is an introduction to Docker intended for those who have no hands on experience with Docker. If you have used Docker you will likely not get much from this session. The material (and hands on portion) is taken from the course that I teach at CMU called DevOps: Engineering for Deployment and Operations. 2017 Len Bass 2

Logistics You should have installed Docker on your laptop either in native mode or using Docker Toolbox. Make sure Hello World works (from the installation instructions). Make sure you have access to the internet since you will be downloading software. 2017 Len Bass 3

Outline Introduction to Docker Hands on What s left? 2017 Len Bass 4

Isolation Process Isolate address space No isolation for files or networks Lightweight Virtual Machine Isolate address space isolate files and networks Heavyweight 2017 Len Bass 5

Containers Process Isolate address space No isolation for files or networks Lightweight Container Isolate address space isolate files and networks Lightweight Virtual Machine Isolate address space isolate files and networks Heavyweight 2017 Len Bass 6

Docker containers 2017 Len Bass 7

Docker Architecture Docker daemon Lives on the host Responds to docker commands Docker daemon Instantiates images and creates containers Image is instantiated to form container 2017 Len Bass 8

Layers A Docker container image is structured in terms of layers. Process for building image Start with base image Load software desired Commit base image+software to form new image New image can then be base for more software Image is what is transferred 2017 Len Bass 9

Loading of software OS is ~ 1GB(yte) Fast network is ~ 1Gb(it) rated Since there are 8 bits per byte, transferring an OS should take 8 seconds. But a 1Gb rated network is ~35Mb in practice This means loading an OS is >30 seconds Consequently, sharing an OS saves >30 seconds per instance. Sharing other software saves more *http://www.tomshardware.com/reviews/gigabit-etherne-bandwidth,2321-3.html 2017 Len Bass 10

Exploiting layers When an image is updated, only update new layers Unchanged layers do not need to be updated Consequently, less software is transferred and an update is faster. 2017 Len Bass 11

Trade offs Virtual machine gives you all the freedom you have with bare metal Choice of operating system Total control over networking arrangement and file structures Container is constrained in terms of operating systems available Currently just Linux but soon Windows and OSX Provides limited networking options Provides limited file structuring options 2017 Len Bass 12

Outline Introduction to Docker Hands on What s left? 2017 Len Bass 13

Hands on portion If you have loaded Docker Toolbox, you have a copy of VirtualBox Set port forwarding on default so that 8080 on host is forwarded to 8080 on VM. 2017 Len Bass 14

docker pull ubuntu Execute docker pull Ubuntu This loads an image from the docker library The image contains bare copy of ubuntu 2017 Len Bass 15

docker images Execute docker images This generates a list of images known to Docker on your machine You should see Hello World and ubuntu 2017 Len Bass 16

docker run i t ubuntu Execute docker run i t Ubuntu This executes an image. An executing image is called a container. You are now inside the container. Execute ls. A directory structure is set up but only a bare bones OS has been loaded 2017 Len Bass 17

Install software on container Execute apt-get update apt-get install wget apt-get install nodejs apt-get install npm <cntl d> This installs the software you will use during this session and exits the container 2017 Len Bass 18

docker ps a Execute docker ps a This generates a list of all of the containers that have been run 2017 Len Bass 19

Output from docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 174268c64fbd ubuntu "/bin/bash" 7 minutes ago Exited (0) About a minute ago sharp_mcnulty 54ae910238b3 hello-world "/hello" 53 minutes ago Exited (0) 53 minutes ago practical_euler 2017 Len Bass 20

docker commit sharp_mcnulty saturn Note that the ubuntu container has a name of sharp_mcnulty (on my machine). It will be different on yours. docker commit sharp_mcnulty saturn creates an image with the name saturn 2017 Len Bass 21

Execute docker images REPOSITORY TAG IMAGE ID CREATED SIZE saturn latest a70567971230 13 seconds ago 456 MB ubuntu latest 0ef2e08ed3fa 8 days ago 130 MB hello-world latest 48b5124b2768 7 weeks ago 1.84 k 2017 Len Bass 22

Execute run i t Saturn You are back inside a container. Load application: wget https://raw.githubusercontent.com/cmudevops/ipshow.js/mast er/initialization_script wget https://raw.githubusercontent.com/cmudevops/ipshow.js/mast er/ipshow.js 2017 Len Bass 23

Exit the container - <cntl d> 2017 Len Bass 24

List containers $docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9c4b32145fa3 saturn "/bin/bash" 2 minutes ago Exited (0) 8 seconds ago reverent_lewin 174268c64fbd ubuntu "/bin/bash" 30 minutes ago Exited (0) 24 minutes ago sharp_mcnulty 54ae910238b3 hello-world "/hello" About an hour ago Exited (0) About an hour ago practical_euler 2017 Len Bass 25

Make an image called ipshow docker commit reverent_lewin ipshow $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE ipshow latest 8f7afedea65d 6 seconds ago 456 MB saturn latest a70567971230 11 minutes ago 456 MB <none> <none> b348af319cbc 21 minutes ago 456 MB ubuntu latest 0ef2e08ed3fa 8 days ago 130 MB hello-world latest 48b5124b2768 7 weeks ago 1.84 k 2017 Len Bass 26

Execute app docker run i t p 0.0.0.0:8080:8080 ipshow /bin/bash /initialization_script In browser: localhost:8080 You should see three ip addresses in the browser: Ip address of local host 127.0.0.1 (conventially this is local host) Ip address of container 2017 Len Bass 27

What have we seen Distinction between docker images and containers Creating a docker image in layers Provisioning the docker image from the internet 2017 Len Bass 28

What is left? Scripting Sharing of images Scaling of images Swarm AWS container service Lambda 2017 Len Bass 29

Scripting Creating an image by hand is tedious and error prone You can create a script to do this (Dockerfile). 2017 Len Bass 30

Sharing image Multiple team members may wish to share images Images can be in production, under development or under test Docker Hub is a repository where images can be stored and shared. Each image is tagged to allow versioning Any image can be pulled to any host (with appropriate credentials) Tagging as latest allows updates to be propagated. Pull <image name>:latest gets the last image checked into repository with that name. 2017 Len Bass 31

Allocation of images to hosts images To run an image, the image and the host must be specified hosts With basic Docker this allocation must be done manually 2017 Len Bass 32

Docker Swarm image To run an image, the image but not the host must be specified Swarm encapsulates hosts A swarm looks like a single host from the point of view of allocation but actually consists of multiple hosts 2017 Len Bass 33

Swarm Master image Run request is sent to swarm master which selects host Swarm Master is a specific container on a host not in the swarm Swarm 2017 Len Bass 34

How do containers get to hosts? Three options Containers can be copied at each invocation. - Copying time is overhead - Makes hosts flexible with respect to which containers they run Containers can be preloaded on hosts - No copying time at invocation - When there are multiple different containers, allocator is constrained to allocate to hosts with appropriate containers. Some layers can be preloaded on hosts - Only copying time for additional layers - Allocator is constrained to allocate to appropriate preloaded software 2017 Len Bass 35

Multiple swarms It is possible to have multiple swarms simultaneously active Swarm discovery token is used to identify which swarm each host belongs to 2017 Len Bass 36

Scaling Swarms Having an instance in a swarm be automatically replicated depending on workload is accomplished by utilizing autoscaling facilities of cloud provider AWS has an EC2 container management facility that combines features of Docker Swarm and autoscaling. 2017 Len Bass 37

AWS EC2 container management 2017 Len Bass 38

AWS Lambda AWS also has a facility called Lambda that consists of preloaded OS + execution engines. Exists for Java Node.js Python C# AWS maintains pool of partially loaded containers that only require app specific layer. Load in micro secs. Only one request per Lambda instance 2017 Len Bass 39

Summary A container is a lightweight virtual machine that provides address space, network, file isolation Docker allows building images in layers and deployment of a new version just requires deploying layers that have changed. Containers can be managed either on VMs through autoscaling or on preallocated pool for short duration, quick loading Development workflow is supported through an image repository. 2017 Len Bass 40

Questions and book pitch 2017 Len Bass 41