Docker Containers Deep Dive

Download Docker Containers Deep Dive

Post on 10-Feb-2017




1 download

Embed Size (px)


<ul><li><p>Docker Containers Deep DiveBest of Red Hat Summit</p><p>Will Kinard</p><p>October 4, 2016</p></li><li><p>Agenda</p><p>2</p><p> Intro</p><p> Containerization 101</p><p> Use Cases</p><p> Build, Ship, Run </p><p> OpenShift</p><p> Q&amp;A</p></li><li><p>3</p><p> DevOps Advisory and Implementation </p><p>Services</p><p> Docker Consulting and Integration</p><p> CloudBees Jenkins Consulting</p><p>AboutThe Container Enablement Company</p><p> Continuous Integration, </p><p>Delivery, and Deployment</p><p> Application Modernization </p><p> Cloud Migration</p></li><li><p>Container Tech Isnt New</p><p>4</p><p>2000</p><p>2002</p><p>2004</p><p>2006</p><p>2007</p><p>1979</p><p>2008</p><p>2013</p><p>ChrootFilesystem isolation</p><p>FreeBSD JailsEarly container technology</p><p>Linux NamespacesProcess isolation</p><p>Solaris ZonesSimilar to jails; snapshots, cloning</p><p>Google Process ContainersProcess aggregation for resource management</p><p>Linux Control GroupsProcess containers renamed and merged into kernel 2.6.24</p><p>LXC Linux ContainersUserland tooling</p><p>DotCloud Docker Inc.Introduction of Docker Open Source Project</p></li><li><p>Docker Open Source Project</p><p>GitHub (</p><p> 2900+ Contributors</p><p> 10,000+ Active Forks</p><p> 34,000+ Stars</p><p>Docker Hub (</p><p> 6B+ Image Downloads</p><p> 500,000+ Dockerized Applications</p><p> Exponential growth</p><p>5</p><p>0</p><p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p><p>2013 2014 2015 2016</p><p>Docker Pulls - Billions</p></li><li><p>What is a Docker Container ?</p><p> Method to run applications in isolation</p><p> Isolation includes namespacing pid, network, users, restricting </p><p>root, cpu and memory limits, and providing separate </p><p>filesystem</p><p> Many of the technologies are old, but haven't been packaged </p><p>in an easy to use toolset before Docker</p><p>6</p><p>Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs </p><p>to run: code, runtime, system tools, system libraries anything you can install on a server. ( </p></li><li><p>Containerized Deployment and Scaling</p><p>Each virtual machine </p><p>includes:</p><p>- application</p><p>- binaries and </p><p>libraries</p><p>- entire guest </p><p>operating system</p><p>Containers:</p><p>- Include application and all dependencies</p><p>- Share kernel with other containers</p><p>- Run as an isolated process not tied to any </p><p>specific infrastructure</p><p>Virtual Machines Containers</p><p>7</p></li><li><p>8</p><p>Were not trying to replace your VMs</p><p>Virtual Machine:</p><p>Host Virtualization</p><p>Containers are used in </p><p>partnership with current IaaS </p><p>stacks.</p><p>Docker and other container </p><p>platforms still need a host.</p><p>Container:</p><p>Application Virtualization</p><p>Take advantage of the streamlined </p><p>process for VM based IaaS and gain </p><p>efficiencies in:</p><p> Higher density workloads</p><p> Scale</p><p> Portability</p><p> Security</p></li><li><p>9</p><p>Portability is Empowering</p></li><li><p>10</p><p>Portability is Empowering</p></li><li><p>11</p><p>Portability is Empowering</p></li><li><p>12</p><p> Containers are designed to be disposable</p><p> New containers go back to a clean image state</p><p> Running containers write to an isolated space</p><p>Immutable</p><p> Data is stored outside of the container</p><p> Separates data from your application</p></li><li><p>13</p><p>Application Development (Build &amp; Ship)</p><p>Problem: Code migration issues: Dev Test Prod. Painful and slow software delivery.</p><p>Solution: Developer Self-Service. Automate and consolidate with Docker.</p><p>Docker packages applications and their dependencies into containers to allow for easy transport from a </p><p>developers laptop to any target test or prod environment. This accelerates the software lifecycle, </p><p>increases reliability, and reduces job time.</p><p>- Begin with a Trusted Known State</p><p>- Control and Approve Content</p><p>- Track Promotion CryptographicallyDeveloper</p><p>Version</p><p>control</p><p>Sysadmin</p><p>QA / QE</p></li><li><p>14</p><p>Application Modernization / Cloud Migration</p><p>Problem: Legacy applications: brittle, and difficult to change/bug fix/upgrade</p><p>Hard to scale, obsolete APIs, costly and difficult to support and maintain.</p><p>Solution: Microservices architecture. Technology diversity. Modular boundaries. </p><p>Mulit-tier applications can be deployed in parts and each tier is an independent container. Each of the containers </p><p>can be used for a single service. Legacy applications can be migrated to the cloud through either a lift &amp; shift or </p><p>refactoring methodology, or potentially a combination. </p></li><li><p>BuildDocker Images</p><p> Images are the definition. They include </p><p>the filesystem, environment variables, </p><p>and default entry points.</p><p> Containers are an instance of an </p><p>image. They isolate the application </p><p>from the host, and even from other </p><p>containers.</p><p>15</p></li><li><p>BuildDockerfiles</p><p> Write your image definition in a Dockerfile</p><p>16</p><p> Turn that Dockerfile into an image with</p><p> Develop a new app or lift and shift your current codebase</p></li><li><p> Union file system</p><p> Multiple RO layers are stacked</p><p> Containers add a single RW layer to </p><p>isolate changes</p><p> Layers are cached for fast builds</p><p> Layers are named with a hash inside </p><p>the engine</p><p>17</p><p>Docker Images</p></li><li><p>Docker for Mac / Windows</p><p> Docker tools for the developer</p><p> OS native clients using internally </p><p>available virtualization: xhyve and </p><p>Hyper-V</p><p> Full Docker CLI from native OS </p><p>shell</p><p>18</p><p>Red Hat Container Dev Kit</p><p> Pre-built container development </p><p>environment</p><p> Choice of virtualization platforms: </p><p>Virtualbox, Hyper-V, Linux KVM</p><p> Eclipse and docker CLI integration</p></li><li><p>ShipDocker Registry (and Hub)</p><p> Push and pull to central registry</p><p>19</p><p> Organized as repositories that contain </p><p>multiple tags</p><p> Multiple options: run your own, Docker </p><p>Hub, OpenShift, 3rd parties</p></li><li><p>Run</p><p>20</p><p> Run your image</p><p> Launches a container base on your image</p><p> Options for:</p><p> Volumes: link external data into the container for persistence</p><p> Networking: bridged, overlay, access with exposed ports</p></li><li><p>RunDistributed</p><p>21</p><p> Fault tolerant</p><p> Blue/Green Deployment</p><p> Seamless rollbacks</p></li><li><p>Distributed</p><p>Docker Compose</p><p> Packages multiple containers together</p><p> Defines parameters for docker run</p><p> Configuration is stored in docker-</p><p>compose.yml</p><p> Allows containers to be scaled, but </p><p>without orchestration</p><p>22</p></li><li><p>Docker on Red Hat</p><p>RHEL</p><p>Consistent performance and reliability</p><p>Certification and Support</p><p>SELinux Security</p><p>Atomic Host</p><p> Minimal footprint operating system</p><p> Linux container optimized</p><p> Reliability and security of RHEL</p><p>23</p></li><li><p>Red Hat OpenShift Container Platform V3</p><p>OpenShift and Kubernetes add the ability to orchestrate </p><p>docker containers across multi-host installations.</p><p>24</p><p> Self-service Platform</p><p> Multi-language Support</p><p> Application Persistence</p><p> Automation</p><p> OpenvSwitch Integration</p><p>Load Docker Images to OpenShift!</p><p># oc new-project rhsummit# oc new-app gitlab/gitlab-ce</p></li><li><p>Thank You!</p><p>25</p><p>Will Kinard</p><p>CTO BoxBoat Technologies</p><p></p><p>@boxboat</p><p></p></li><li><p>Appendix</p><p>26</p></li><li><p>This is Important</p><p>27</p></li><li><p>28</p><p> Isolated space for a running application</p><p> All containers run on the same kernel unlike a VM</p><p> Eliminates the overhead of an OS and services </p><p>Come Again?</p></li><li><p>Docker Containers Run Anywhere?</p><p>Linux: </p><p>Kernel Version 3.10+</p><p> Ubuntu 13.10+</p><p> Fedora 20+</p><p> RHEL 7+</p><p> CentOS 7.1+</p><p> Gentoo</p><p> ArchLinux</p><p> openSUSE 13.1+</p><p> CRUX 3.0+</p><p>Windows (Really!):</p><p> Docker for Windows</p><p> Windows Server 2016 (TP5)</p><p>29</p><p>Docker for ARM!</p></li><li><p>Production Operations / Data CenterProblem: Inefficiency of VMs .. O/S duplication Lengthy boot and replication times. </p><p>Hardware, Storage, and Hypervisor costs $$. </p><p>Solution: Dockers containers as a service (CaaS) and orchestration platform. Policy driven architecture.</p><p>Deployment flexibility (On-Premise, Cloud, Hybrid). </p><p>Docker containers share resources with the host OS, which makes them significantly more efficient than VMs. </p><p>Containers can be started and stopped in a fraction of a second. They are lightweight, fast, and maximize </p><p>consolidation. Swisscom reduced their VM footprint from 400 to 20 for a database as a service offering, driving </p><p>tremendous cost savings. </p></li><li><p>ControlManage and secure </p><p>at scale</p><p>PortabilityFrictionless </p><p>Movement &amp; Trust</p><p>AgilityInnovation at </p><p>speed</p><p>+ +Build Ship Run</p><p>31</p></li><li><p>32</p><p>Isolated</p><p> Isolated filesystem</p><p> Namespace for isolating pids</p><p> cgroups for limiting memory and CPU</p><p> Separate network stack</p><p> Restricted root capabilities </p></li><li><p>Docker Notary</p><p> Open source project on github</p><p>(</p><p> Trusted cross platform content </p><p>distribution</p><p> Platform agnostic in delivering </p><p>content</p><p> Publisher key validates integrity </p><p>of content</p><p>33</p></li><li><p>Portable</p><p> Run Docker containers </p><p>unchanged in any </p><p>environment, on any </p><p>infrastructure</p><p> Move applications at </p><p>will between </p><p>environments and </p><p>infrastructures</p><p>34</p></li><li><p>At Scale</p><p>Docker containers spin up and down in seconds, </p><p>making it easy to scale application services to </p><p>satisfy peak customer demand, and then reduce </p><p>running containers when demand ebbs.</p><p>35</p></li></ul>