Docker 101 describing basic docker usage

ZiyanMaraikar1 155 views 41 slides Jun 19, 2024
Slide 1
Slide 1 of 41
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41

About This Presentation

Docker 101 describing basic docker usage


Slide Content

Docker 101 Mike Coleman – Technology Evangelist, Docker @mikegcoleman

2 Who Am I? Technology evangelist at Docker 1 st half of my career was in IT \ Networking admin 2 nd half of my career has been in product management \ marketing for Docker, Puppet Labs, VMware, and Microsoft. Definitely more IT pro than developer @mikegcoleman (but mostly I tweet about the Portland Timbers)

Agenda Containers are NOT VMs Working with Docker (Build, Ship, Run) But Why? Getting started Q & A

Containers are not VMs

5 Docker c ontainers are NOT VMs Easy connection to make Fundamentally different architectures Fundamentally different benefits

6 VMs

7 Containers

Docker + Windows Server = Windows Containers Native Windows containers powered by Docker Engine Windows kernel engineered with new primitives to support containers Deep integration with 2+ years of engineering collaboration in Docker Engine and Windows Server Microsoft is top 5 Docker open source project contributor and a Docker maintainer Infrastructure Windows Server 2016 Bins/Libs App Docker Engine Bins/Libs App Bins/Libs App

9 They’re different, not mutually exclusive

Variables to Consider Performance Security Scalability Existing Skillsets Costs Etc. http://people- equation.com /do-your-words-encourage-or-deflate/math- equation_chalkboard /

11 Container Consolidation Testing Testing done by HPE, Docker and Industry Consultant Components: Docker CS Engine 1.12.3 VMware ESXi 6 SysBench 1.0 (Nov 2016) RHEL 7.2 HPE ProLiant DL360 Gen 9 servers with HPE 3PAR StorServ 8200 SSD Storage How can containers help organizations optimize hardware utilization?

12 Testing Scenarios Measure SysBench p erformance a cross 3 configurations Need to replace this graphic w/ the one w/ 8 boxes Scenario 1: 8 VMs Scenario 2: 1 VM w/ 8 Containers Scenario 3: 8 Containers on Bare Metal

13 Results Moving from VMs to containers increases performance 27% to 46% Results are after VM and Container Tuning

14 Additional Savings Docker allowed for savings in memory and disk as well

15 Key Learnings Docker containers increase performance and flexiblity 2 1 3

Build, Ship, and Run

18 Put it all together: Build, Ship, Run Workflow Developers IT Operations BUILD Development Environments SHIP Create & Store Images RUN Deploy, Manage, Scale

Docker Engine Load Balancing Certificate Authority Networking Service Discovery TLS Swarm Mode Manager Swarm Mode Worker Orchestration Components Volumes Plugins Distributed store Container Runtime The building block: Docker Engine 1.12 Powerful yet simple, built in orchestration Declarative app services Built in container centric networking Built in default security Extensible with plugins, drivers and open APIs Built in orchestration with scheduling, networking and scheduling

Docker Universal Control Plane Integrated Security Docker Engine Container runtime, orchestration, networking, volumes, plugins Docker Trusted Registry Operating Systems Config Mgt Monitoring Logging CI/CD ..more.. Images Networking Volumes Virtualization Public Cloud Physical Docker Datacenter platform Docker Datacenter

Docker Datacenter Architecture UCP Manager UCP Manager UCP Manager Internal distributed store Raft consensus group BYO TCP Load Balancer

Docker Datacenter Architecture UCP Worker UCP Worker UCP Worker UCP Worker Admin / User Deploy / manage UCP Manager UCP Manager UCP Manager Internal distributed store Raft consensus group BYO TCP Load Balancer

Docker Datacenter Architecture UCP Worker UCP Worker UCP Worker UCP Worker Admin / User Deploy / manage UCP Manager UCP Manager UCP Manager Internal distributed store Raft consensus group BYO TCP Load Balancer DTR Replica Worker Image Registry BYO TCP Load Balancer DTR Replica Worker DTR Replica Worker push / pull LDAP/AD Monitoring Logging External CA Image Storage

24 Some Docker vocabulary Docker Image The basis of a Docker container. Represents a full application Docker Container The standard unit in which the application service resides and executes Docker Engine Creates, ships and runs Docker containers deployable on a physical or virtual, host locally, in a datacenter or cloud service provider Registry Service (Docker Hub or Docker Trusted Registry) Cloud or server based storage and distribution service for your images

Basic Docker Commands $ docker pull mikegcoleman/catweb:1.0 $ docker images $ docker run –d –p 5000:5000 –-name catweb mikegcoleman/ catweb:latest $ docker ps $ docker stop catweb (or <container id>) $ docker rm catweb (or <container id>) $ docker rmi mikegcoleman/ catweb:latest (or <image id>) $ docker build –t mikegcoleman/catweb:2.0 . $ docker push mikegcoleman/catweb:2.0

26 Dockerfile – Linux Example Instructions on how to build a Docker image Looks very similar to “native” commands Important to optimize your Dockerfile

Dockerfile – Windows Example

Demo Build, Ship, and Run

Now you try it! Visit http:// docs.docker.com/installation Install the right version of Docker for your machine Docker for Mac Docker for Windows After Docker is installed, run Catweb docker run –d –p 5000:5000 --name catweb mikegcoleman/catweb Browse to port 5000 on your machine http://localhost:5000

Docker Container Architecture

31 Image Layers Kernel Alpine Linux Install Python and Pip Upgrade Pip Copy Requirements Install Requirements …

32 Docker File System Logical file system by grouping different file system primitives into branches (directories, file systems, subvolumes , snapshots) Each branch represents a layer in a Docker image Allows images to be constructed / deconstructed as needed vs. a huge monolithic image ( ala traditional virtual machines) When a container is started a writeable layer is added to the “top” of the file system

33 Copy on Write Super efficient: Sub second instantiation times for containers New container can take <1 Mb of space Containers appears to be a copy of the original image But, it is really just a link to the original shared image If someone writes a change to the file system, a copy of the affected file/directory is “copied up”

34 What about data persistence? Volumes allow you to specify a directory in the container that exists outside of the docker file system structure Can be used to share (and persist) data between containers Directory persists after the container is deleted Unless you explicitly delete it Can be created in a Dockerfile or via CLI

But Why?

Enterprises are looking to Docker for critical transformations 80% Docker is central to cloud strategy Docker Survey: State of App development : Q1 - 2016 3 out 4 Top initiatives revolve around applications 44% Looking to adopt DevOps App Modernization DevOps Cloud State of App development Survey: Q1 2016

37 Docker delivers speed, flexibility and savings + + Agility Portability Control State of App development Survey: Q1 2016, Cornell University case study 13X More software releases 62% Report reduction in MTTR 10X Cost reduction in maintaining existing applications Eliminate “works on my machine” issues 41% Move workloads across private/public clouds 65% Reduction in developer onboarding time

One platform delivers one journey for all applications 1 Containerize Legacy Applications Lift and shift for portability and efficiency 2 3 Transform Legacy to Microservices Look for shared services to transform Accelerate New Applications Greenfield innovation

Docker Universal Control Plane Integrated Security Docker Engine Docker Trusted Registry Config Mgt Monitoring Logging CI/CD ..more.. Images Networking Volumes Virtual Public Cloud Containers in production with Docker Datacenter Enterprise container orchestration, management and security for dev and ops Available today for Linux environments Q4 2016 beta for Windows environments Physical

Getting Started

41 Docker on Linux Create a L inux VM (or use physical), and install Docker Requires kernel 3.10 Stable builds curl – sSL https://get.docker.com/ | sh Test and experimental builds curl – sSL https://test.docker.com/ | sh curl – sSL https://experimental.docker.com/ | sh Can also manually install (see docs)

Docker for Windows / Mac Currently in public beta Easy to install: Get up and running on Docker in minutes Leverages Hyper-V (Windows) or xhyv (Mac) Docker for Windows requires Windows Pro 10, Enterprise, or Education Full API / CLI compatibility OS integration for increased stability and speed
Tags