Slide 1

Slide 1 text

Docker Introduction 中國醫藥大學 2018/04/27 Samina Fu

Slide 2

Slide 2 text

Copyright 2015 ITRI 工業技術研究院 • What is Docker • Container Introduction • Why Docker • Integrate into many infra tool w/ Docker • Docker Overview • How to install Docker • Docker commands • Additional Outline

Slide 3

Slide 3 text

Copyright 2015 ITRI 工業技術研究院 • What is Docker • Container Introduction • Why Docker • Integrate into many infra tool w/ Docker • Docker Overview • How to install Docker • Docker commands • Additional Outline

Slide 4

Slide 4 text

Copyright 2015 ITRI 工業技術研究院 What is Docker • A Docker, Inc. Company • Operating System-Level Virtualization • A tool ▪ Package an application & its dependencies in a virtual container ▪ Implements a high-level API to provide lightweight containers (processes in isolation) • A most famous & popular container technology in the 21st century • Launch of Docker @ PyCon Lightning Talk, March 13, 2013 ▪ Title: The future of Linux Containers • Solomon Hykes started internal Docker in dotCloud(PAAS company) • Repository: https://github.com/docker, Website: https://www.docker.com/, Documentation: https://docs.docker.com/

Slide 5

Slide 5 text

Copyright 2015 ITRI 工業技術研究院 • What is Docker • Container Introduction ▪ What is Container ▪ Container technology ▪ Comparing Containers and Virtual Machines • Architecture • Performance • Why Docker • Integrate into many infra tool w/ Docker • Docker architecture • How to install Docker • Docker commands • Additional Outline

Slide 6

Slide 6 text

Copyright 2015 ITRI 工業技術研究院 What is Container • Package software into standardized units • Container image ▪ A lightweight, stand-alone, executable package of a piece of software • Include: code, runtime, system tools, system libraries, settings • Isolate software from environment’s surroundings • Container Introduction • What is Container • Container technology • Comparing Containers & VM • Architecture • Performance Ref: https://www.docker.com/what-container#/package_software

Slide 7

Slide 7 text

Copyright 2015 ITRI 工業技術研究院 • Container Introduction • What is Container • Container technology • Containers vs VM • Architecture • Performance • Docker: https://docker.com • LXC: https://linuxcontainers.org/ • OpenVZ: https://openvz.org/Main_Page • Containerd: https://containerd.io/ • Moby: https://mobyproject.org/ • FreeBSD Jails: https://www.freebsd.org/doc/handbook/jails.html • Container Standards and Industry Leadership Ref: https://www.plesk.com/blog/business-industry/infographic-brief-history-linux-containerization/ Container technology

Slide 8

Slide 8 text

Copyright 2015 ITRI 工業技術研究院 [Architecture] Comparing Containers & Virtual Machines • Container Introduction • What is Container • Container technology • Containers vs VM • Architecture • Performance Ref: https://www.docker.com/what-container#virtual_machines

Slide 9

Slide 9 text

Copyright 2015 ITRI 工業技術研究院 [Performance] Start & Stop Time Start Time Stop Time Docker Containers < 50 ms < 50 ms Virtual Machines 30 ~ 45 secs 5 ~ 10 secs • Container Introduction • What is Container • Container technology • Containers vs VM • Architecture • Performance • Start & Stop Time • Bechmarks • Applications Ref: https://www.slideshare.net/Flux7Labs/performance-of-docker-vs-vms

Slide 10

Slide 10 text

Copyright 2015 ITRI 工業技術研究院 [Performance] Benchmarks • Container Introduction • What is Container • Container technology • Containers vs VM • Architecture • Performance • Start & Stop Time • Benchmarks • Applications Ref: https://www.slideshare.net/KentoAoyama/an-updated-performance-comparison-of-virtual-machines-and-linux-con tainers-73758906 Perf. Category Docker KVM CPU Good Bad+ Memory Bandwidth (sequential) Good Good Memory Bandwidth (Random) Good Good Network Bandwidth Acceptable+ Acceptable+ Network Latency Bad Bad Block I/O (sequential) Good Good Block I/O (RamdomAccess) Good (Volume Option) Bad Comparing to native performance Equal Good A little worse Acceptable Worse Bad

Slide 11

Slide 11 text

Copyright 2015 ITRI 工業技術研究院 [Performance] Applications • Container Introduction • What is Container • Container technology • Containers vs VM • Architecture • Performance • Start & Stop Time • Benchmarks • Applications Ref: https://www.slideshare.net/KentoAoyama/an-updated-performance-comparison-of-virtual-machines-and-linux-conta iners-73758906 Another research from IBM in 2014: https://domino.research.ibm.com/library/cyberdig.nsf/papers/0929052195DD819C85257D2300681E7B/$File/rc254 82.pdf Perf. Category Docker KVM Default Net=Host Volume Redis (Request/sec) Acceptable Good - Acceptable Redis (Latency) Acceptable Good - Acceptable MySQL (Transations/sec) Acceptable - Good Bad MySQL (Latency) Acceptable - Good Bad Comparing to native performance Equal Good A little worse Acceptable Worse Bad

Slide 12

Slide 12 text

Copyright 2015 ITRI 工業技術研究院 • What is Docker • Container Introduction • Why Docker • Integrate into many infra tool w/ Docker • Docker Overview • How to install Docker • Docker commands • Additional Outline

Slide 13

Slide 13 text

Copyright 2015 ITRI 工業技術研究院 Why Docker • Security • Isolation • Scalability • Lightweight • Efficiency • Speed • Density • Fast deployment: shipping, testing, and deploying code quickly • Environment consistency • Significantly reduce the delay between writing code and running it in production Ref: https://docs.docker.com/get-started/

Slide 14

Slide 14 text

Copyright 2015 ITRI 工業技術研究院 • What is Docker • Container Introduction • Why Docker • Integrate into many infra tool w/ Docker • Docker Overview • How to install Docker • Docker commands • Additional Outline

Slide 15

Slide 15 text

Copyright 2015 ITRI 工業技術研究院 Integrate into many infra tool w/ Docker Ref: https://en.wikipedia.org/wiki/Docker_(software)

Slide 16

Slide 16 text

Copyright 2015 ITRI 工業技術研究院 Outline • What is Docker • Container Introduction • Why Docker • Integrate into many infra tool w/ Docker • Docker Overview ▪ Docker Engine ▪ Docker Architecture ▪ Docker Objects ▪ The underlying technology • How to install Docker • Docker commands • Additional

Slide 17

Slide 17 text

Copyright 2015 ITRI 工業技術研究院 • A lightweight & powerful open source containerization technology ▪ Combined with • workflow for building • containerizing applications • A client-server application • Include these major components: ▪ Server: A long-running program called daemon process ▪ REAT API: Specifies interfaces programs can talk & instruct to daemon ▪ Client: A command line interface (CLI) Client (Docker CLI) Docker Engine • Docker Overview • Docker Engine • Docker Architecture • Docker Objects • The underlying technology

Slide 18

Slide 18 text

Copyright 2015 ITRI 工業技術研究院 Docker Engine (cont.) • Docker Overview • Docker Engine • Docker Architecture • Docker Objects • The underlying technology • Workflow ▪ CLI uses Docker REST API to control or interact with the Docker daemon ▪ Daemon creates & manages Docker objects • Objects: images, containers, networks, and volumes

Slide 19

Slide 19 text

Copyright 2015 ITRI 工業技術研究院 Docker Architecture Ref: https://docs.docker.com/engine/docker-overview/#what-can-i-use-docker-for • Docker Overview • Docker Engine • Docker Architecture • Docker Objects • The underlying technology https://hub.docker.com/

Slide 20

Slide 20 text

Copyright 2015 ITRI 工業技術研究院 Docker Objects • IMAGES ▪ A read-only template with instructions for creating a Docker container • CONTAINERS ▪ The instance of an image ▪ Can create, start, stop, move, or delete a container using Docker API or CLI • Docker Overview • Docker Engine • Docker Architecture • Docker Objects • The underlying technology

Slide 21

Slide 21 text

Copyright 2015 ITRI 工業技術研究院 The underlying technology • Namespaces ▪ Provide the isolated workspace • Control groups (Cgroups) ▪ Limits an application to a specific set of resources • Union file systems (UnionFS) ▪ Provide the building blocks for containers ▪ Operate by creating layers ▪ Making UnionFS very lightweight and fast ▪ Docker Engine can use multiple UnionFS variants • Including AUFS, btrfs, vfs, and DeviceMapper • Container format ▪ A wrapper combines namespaces, Cgroups, & UnionFS into Docker Engine ▪ default container format is libcontainer • Docker Overview • Docker Engine • Docker Architecture • Docker Objects • The underlying technology

Slide 22

Slide 22 text

Copyright 2015 ITRI 工業技術研究院 Outline • Docker Introduction ▪ What is Docker ▪ Container Introduction ▪ Why Docker ▪ Integrate into many infra tool w/ Docker ▪ Docker Overview ▪ How to install Docker ▪ Docker commands ▪ Additional • Kubernetes Introduction

Slide 23

Slide 23 text

Copyright 2015 ITRI 工業技術研究院 How to install Docker • Install Docker for free Community Edition (CE) • Ubuntu: https://docs.docker.com/install/linux/docker-ce/ubuntu/ • CentOS: https://docs.docker.com/install/linux/docker-ce/centos/ • Windows: https://docs.docker.com/docker-for-windows/install/#what-to-know-before-you-i nstall • Mac: https://docs.docker.com/docker-for-mac/install/ Ref: https://www.docker.com/community-edition

Slide 24

Slide 24 text

Copyright 2015 ITRI 工業技術研究院 • What is Docker • Container Introduction • Why Docker • Integrate into many infra tool w/ Docker • Docker Overview • How to install Docker • Docker commands • Additional Outline

Slide 25

Slide 25 text

Copyright 2015 ITRI 工業技術研究院 Docker commands Ref: https://docs.docker.com/engine/reference/commandline/cli/

Slide 26

Slide 26 text

Copyright 2015 ITRI 工業技術研究院 Docker commands (cont.) Ref: https://zeroturnaround.com/rebellabs/docker-commands-and-best-practices-cheat-sheet/

Slide 27

Slide 27 text

Copyright 2015 ITRI 工業技術研究院 Docker commands (cont.) Ref: https://blog.fntsr.tw/articles/2014/12/15/docker-command-diagram/

Slide 28

Slide 28 text

Copyright 2015 ITRI 工業技術研究院 • What is Docker • Container Introduction • Why Docker • Integrate into many infra tool w/ Docker • Docker Overview • How to install Docker • Docker commands • Additional Outline

Slide 29

Slide 29 text

Copyright 2015 ITRI 工業技術研究院 Additional • Try http://play-with-docker.com, if you want. • GitHub Repository: https://github.com/play-with-docker/play-with-docker

Slide 30

Slide 30 text

Copyright 2015 ITRI 工業技術研究院 Additional (cont.) • Dockerfile ▪ https://docs.docker.com/engine/reference/builder/ • Docker Compose ▪ https://docs.docker.com/compose/compose-file/ • Docker Swarm ▪ https://docs.docker.com/engine/swarm/

Slide 31

Slide 31 text

Thank you!