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

Docker Internals

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Docker Internals

Twilio talk - 11/14/2013

Avatar for Guillaume J. Charmes

Guillaume J. Charmes

November 14, 2013

More Decks by Guillaume J. Charmes

Other Decks in Technology

Transcript

  1. By  Guillaume  J.  Charmes  <[email protected]>          

           @charme_g   Docker  version  0.6.6  /  0.7.0-­‐rc5   Docker Internals SF Docker Meetup at Twilio ##dockermeetup   11/14/2013  
  2. Isolation •  LXC •  Cgroups/Namespaces •  Processes •  Mounts • 

    Network •  Network •  NAT (DOCKER chain) •  Expose / Links •  File System •  Chroot on steroids
  3. Isolation •  Isolation: Namespaces •  Only 1 syscall (setns()). No

    hypervisor •  Mounts, Uts (hostname), Net, Pid, IPC, User •  Resource management: Cgroups •  Memory Limitation •  CPU Shares •  Future: blkio
  4. Isolation •  Network •  Bridge •  Veth •  NAT • 

    Expose / Links •  File System •  Chroot++ •  Image management
  5. Images •  AUFS •  Image format •  Base image • 

    Layer + parent id •  Whiteouts (.wh.) •  Difference Image vs Container •  Registry •  Future •  Devicemapper •  Backend interface
  6. Images •  Why AUFS? •  Production usage for years • 

    Layers •  Multiple RO layers, 1 RW -> Diff •  Limitations •  42 layers •  Whiteouts •  Deletion management
  7. Images •  Image format •  Payload (layer) •  Metadata (parent

    id) •  Image vs Container •  Differences •  Future: Unified format
  8. Images •  Image sharing: Registry •  Push/Pull via diffs • 

    Future •  Backend interface / Devicemapper •  Unified image format: whiteouts (.wh.)
  9. •  Docker daemon •  Transports unix/tcp internals •  Attach logic

    •  Logs •  Host Integration •  Dockerfile •  RUN •  EXPOSE •  What is the Context? •  Service Discovery docker  run   Process Management
  10. •  Docker daemon •  Transports: •  Holds all containers • 

    Handles the logging •  Docker client •  Everything uses the Remote API docker  –d  –H  tcp://127.0.0.1:4243  –H  unix:///var/run/docker.sock   Process Management
  11. Process Management internals •  Create •  Start •  Attach • 

    General Config vs Host Config •  Attach protocol •  TTY •  Non-TTY docker    run  
  12. Roadmap •  Docker 0.7 •  File system backend interface • 

    Docker 0.8 •  Isolation backend interface •  Full introspection •  Future •  Ambassador Pattern
  13. Conclusion •  Wide global support with backend interfaces •  Service

    discovery improvement •  Road to multi host / orchestration