Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to Docker and Linux Containers @ Cloud Computing Rhein Main

831 views

Published on

  • Be the first to comment

Introduction to Docker and Linux Containers @ Cloud Computing Rhein Main

  1. 1. Docker Intro Puja Abbassi @puja108 http://giantswarm.io
  2. 2. Simple microservice infrastructure, built for developers. Currently in free Alpha Looking for feedback http://giantswarm.io/ W e’re hiring
  3. 3. Agenda 1) Docker Intro ● Why are we so excited? ● What is Docker? ● Getting started 2) Docker Microservices
  4. 4. Docker is an open-source project to easily create lightweight, portable, self- sufficient containers from any application.” “ Linux
  5. 5. Why are we so excited?
  6. 6. Installation My Mac Timo’s Linux Test Staging Cloud VM Bare Metal Rails Web Frontend ? ? ? ? ? ? Node.js API ? ? ? ? ? ? Background jobs ? ? ? ? ? ? MySQL ? ? ? ? ? ? Distributed DB ? ? ? ? ? ? Message Queue ? ? ? ? ? ?
  7. 7. Reusable Containers My Mac Timo’s Linux Test Staging Cloud VM Bare Metal Rails Web Frontend Node.js API Background jobs MySQL Distributed DB Message Queue
  8. 8. Speed Ships within ... Manual deployment takes ... Automated deployment takes ... Boots in ... Bare metal Days Hours Minutes Minutes Virtual machine Minutes Minutes Seconds < Minute Container Seconds Minutes Seconds Seconds
  9. 9. Dev ⇔ DevOps - Separation of Concerns Dev: Inside the container ● my code ● my libraries ● my package manager ● my app ● my data Ops: Outside the container ● Logging ● Remote Access ● Network Configuration ● Monitoring
  10. 10. Who’s Using Containers?
  11. 11. What is Docker?
  12. 12. Based on existing technologies ● Namespaces > Varying views on the system > to provide isolated environments > PID, NET, IPC, MNT, UTS, User ● CGroups > control resources for a group of processes > like CPU time, Memory, Network bandwidth, etc. ● Layered FS ● (LXC)
  13. 13. Layered FS Base Image Image bootfs Image Writable Container Application Code NodeJS Nginx Ubuntu Cgroups, Namespaces, Device Mapper, Kernel
  14. 14. But {insert some great UNIX here} has had this for years.”“
  15. 15. Docker History ● Jan 2013: Initial commit ● September 2013: Redhat announces collaboration ● June 2014: Google announces engagement ● August 2014: VMWare announces Docker support ● February 2015: Microsoft announces Docker support ● April 2015: Docker raises $95 Million ● June 2015: Open Container Project announced
  16. 16. Docker is awesome and here to stay.
  17. 17. Getting started
  18. 18. Installation ● Mac, Windows: Boot2Docker ● Ubuntu: $ sudo apt-get install docker.io
  19. 19. Run Containers # run a command $ docker run busybox echo hello # run an interactive shell $ docker run -i -t busybox /bin/sh # run a Redis cache $ docker run -d redis
  20. 20. A Node Script // server.js var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(8080); console.log('Server running');
  21. 21. Simple Dockerfile FROM ubuntu:latest RUN apt-get update RUN apt-get install -y nodejs ADD server.js . EXPOSE 8080 CMD ["/usr/bin/nodejs", "/server.js"]
  22. 22. Build, Push, and Run # build the image $ docker build -t puja108/node . # push it to the registry $ docker push puja108/node # run it (on any host) $ docker run -d puja108/node
  23. 23. dockerbook.com
  24. 24. Docker in Development
  25. 25. ● Vagrant ● rbenv ● nodeenv ● virtualenv ● Laptop full of build tools and servers Your current setup?
  26. 26. ● Contains Build Tools ○ Can also be a separate container ● One (or more) container(s) for each stack ○ Use Docker Compose ● Runs the same regardless on which host or in which environment ● Lightweight ○ Developer can actually have several environments open directly on her laptop Dev Containers
  27. 27. Docker Build Chain
  28. 28. Jenkins - Docker Hub Integration Jenkins - Docker Hub Integration
  29. 29. Docker Enables new Architecture Patterns
  30. 30. Patterns for the Cloud Microservices Responsive Manifesto
  31. 31. ● Microservice Architectures > Simple focussed services > Highly decoupled > Communicate over lightweight mechanisms > HTTP APIs & Message Queues > Polyglot (Language, Framework, Data Store) > Built to fail ● Immutable Infrastructures > Disposable components > Make your state explicit > Configure at run-time The Next Steps in Cloud Architecture
  32. 32. Containers vs. VMs Container ● Lightweight layers above a shared kernel ● Single service or process ● New but promising technology ● Enable #GIFEE VM ● Complete (heavy) Virtual System ● Application(s) with several components ● Tried and trusted Technology
  33. 33. Should I start with Docker?
  34. 34. Yes!
  35. 35. Containers are only 1% of your problem.”“ Kelsey Hightower, CoreOS
  36. 36. Thanks for listening! Reach out: Puja Abbassi @puja108 @giantswarm
  37. 37. Namespaces The pid namespace: Used for process isolation (PID: Process ID). The net namespace: Used for managing network interfaces (NET: Networking). The ipc namespace: Used for managing access to IPC resources (IPC: InterProcess Communication). The mnt namespace: Used for managing mount-points (MNT: Mount). The uts namespace: Used for isolating kernel and version identifiers. (UTS: Unix Timesharing System).
  38. 38. CGroups Control group of processes. Share available hardware resources. Set up limits and constraints. E.g. limiting the memory available to a specific container.

×