Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker-intro

 Docker-intro

Samina (Shan Jung Fu)

April 26, 2018
Tweet

More Decks by Samina (Shan Jung Fu)

Other Decks in Technology

Transcript

  1. 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
  2. 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
  3. 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/
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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/
  13. 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
  14. Copyright 2015 ITRI 工業技術研究院 Integrate into many infra tool w/

    Docker Ref: https://en.wikipedia.org/wiki/Docker_(software)
  15. 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
  16. 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
  17. 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
  18. 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/
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. Copyright 2015 ITRI 工業技術研究院 Additional • Try http://play-with-docker.com, if you

    want. • GitHub Repository: https://github.com/play-with-docker/play-with-docker
  26. 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/