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

Docker - FossetCon 2014

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →
Avatar for Lance Hudson Lance Hudson
September 13, 2014

Docker - FossetCon 2014

Avatar for Lance Hudson

Lance Hudson

September 13, 2014

Other Decks in Technology

Transcript

  1. DOCKER AND WHY YOU SHOULD BE USING IT To follow

    along with the slides open http://lancehudson.com/DockerTalk/
  2. ABOUT ME ­ LANCE HUDSON Hacker/Developer/DevOps GlobalOptions, Inc. Senior Software

    Developer FamiLAB - Orlando’s Community Lab aka Hackerspace aka Makerspace Vice President
  3. HACKER? A person who enjoys exploring the details of programmable

    systems and stretching their capabilities, as opposed to most users, who prefer to learn only the minimum necessary. -- Jargon File
  4. WHAT IS DOCKER? Docker is a platform for developers and

    sysadmins to build, ship, and run distributed applications.
  5. WHAT DOES DOCKER DO? Docker packages any application in any

    language using any toolchain into a container. This container can be deployed anywhere and it will run exactly the same.
  6. WHY? ­ DEVELOPERS Portable Pre-packaged applications Plugins into the build

    pipeline The application in production is exactly the same as the application running in QA
  7. WHY? ­ SYS ADMINS Standarized Environments in development, QA and

    production No more "works on my machine" Simplify dependency management Ease of scaling
  8. HOW DOES DOCKER WORK? LinuX Containers (LXC) - Kernel technology

    AuFS - Layered filesystem TAP Networking - Virtual Networking
  9. LINUX CONTAINERS (LXC) LXC is a userspace interface for the

    Linux kernel containment features. Namespaces (ipc, uts, mount, pid, network and user) Apparmor and SELinux profiles Seccomp policies Chroots (using pivot_root) Kernel capabilities Control groups (cgroups) For more information: https://linuxcontainers.org/
  10. AUFS AuFS is a layered file system, so you can

    have a read only part, and a write part, and merge those together. So you could have the common parts of the operating system as read only, which are shared amongst all of your containers, and then give each container its own mount for writing.
  11. VIRTUAL NETWORKING There is a virtual network on each docker

    host. Each machine gets an adapter on that network.
  12. TYPICAL ENVIRONMENT Static web Web frontend Web services Queues Databases

    Data Warehouses Workers Multiple dependencies to manage Differences between production, staging, qa, development “DLL HELL” "Works on my machine"
  13. HOW CAN YOU USE IT? Easy Deployment Continuous Integration Platform

    as a service Continuous Delivery Development Environment Build Pipelines Micro Services
  14. EASY APPLICATION DEPLOYMENT ­ EBAY Fails on a clean Ubuntu

    (precise) install p i p i n s t a l l l x m l Duh... Install OS Dependencies s u d o a p t - g e t i n s t a l l p y t h o n - d e v l i b x m l 2 - d e v l i b x s l t 1 - d e v Vagrant i n s t a l l _ c m d = " a p t - g e t u p d a t e ; a p t - g e t i n s t a l l - y p y t h o n - d e v " \ " l i b x m l 2 - d e v l i b x s l t 1 - d e v ; p i p i n s t a l l - r r e q u i r e m e n t s . t x t ; " c o n f i g . c m . p r o v i s i o n : s h e l l , : i n l i n e = > i n s t a l l _ c m d
  15. EASY APPLICATION DEPLOYMENT ­ EBAY Containerize service dependencies and address

    thema s environment variables. F R O M t e d d z i u b a / p y t h o n 2 . 7 A D D r e q u i r e m e n t s . t x t / t m p / r e q u i r e m e n t s . t x t R U N p i p i n s t a l l - r / t m p / r e q u i r e m e n t s . t x t d o c k e r r u n - d t e d d z i u b a / p o s t g r e s q l - d e v e l o p m e n t - 9 . 2 d o c k e r r u n - t - i - p 8 0 0 0 : 8 0 0 0 - e D A T A B A S E _ U R L = ' . . . ' - v / p a t h / t o / s r c : / a p p - d e v e b a y n o w p y t h o n / a p p - d e v / m a n a g e . p y r u n s e r v e r 0 . 0 . 0 . 0 : 8 0 0 0
  16. CONTINUOUS DELIVERY ­ CAMBRIDGE HEALTHCARE Converted their entire staging environment

    from a handful of AMI's to a single docker host Whenever a new github branch get started, Jenkins (Continuous Integration Server) automatically builds a new Docker image from it. If all tests pass the container becomes avaliable internally and they recieve a campfire notification. Otherwise the Docker image is left behind for examination.
  17. DEVELOPMENT ENVIRONMENTS & BUILD PIPELINES ­ SPOTIFY Started by looking

    at LXC and started writing small scripts to build containers After going down that path noticed that what they were building was very much like Docker
  18. DEVELOPMENT ENVIRONMENTS & BUILD PIPELINES ­ SPOTIFY HOW FAR ARE

    THEY? Built internal VM for running docker Built base images for the internal services Integrated into Team City Build Pipeline Deployed to production (before verison 1.0) Created Helios - Container Orchestration Platform
  19. MICRO SERVICES ­ GLOBALOPTIONS, INC Lots (100+) services that each

    do one thing really well Layered together by the load balancer (service bus) into a single versioned api
  20. MICRO SERVICES ­ GLOBALOPTIONS, INC Each service: is in its

    own container can be scaled horizontally can each have their own dependencies can be in the language that best meets the need has its own metrics
  21. GETTING STARTED & RESOURCES http://docker.io RESOURCES cli - dockerfiles -

    stack overflow - coreos - control center - project atomic - revealjs - https://docs.docker.com/reference/commandline/cli/ https://docs.docker.com/reference/builder/ https://stackoverflow.com/questions/tagged/docker https://coreos.com/ http://controlcenter.io/ http://www.projectatomic.io/ http://lab.hakim.se/reveal-js/