Docker Internals
SF Docker Meetup at Twilio
11/14/2013
Docker version 0.6.6 / 0.7.0-rc5

##dockermeetup

By Guillaume J. Charmes <guillaume@docker.com>

@charme_g
This is your last chance

1.
2.
3.
4.

Isolation
Images
Process Management
Roadmap
Isolation
• LXC
•
•
•
•

Cgroups/Namespaces
Processes
Mounts
Network

• Network
• NAT (DOCKER chain)
• Expose / Links

• File System
• Chroot on steroids
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
Isolation
• Network
•
•
•
•

Bridge
Veth
NAT
Expose / Links

• File System
• Chroot++
• Image management
1.
2.
3.
4.

Isolation
Images
Process Management
Roadmap
Images
• AUFS
• Image format
•
•
•
•

Base image
Layer + parent id
Whiteouts (.wh.)
Difference Image vs Container

• Registry
• Future
• Devicemapper
• Backend interface
Images
• Why AUFS?
• Production usage for years
• Layers
• Multiple RO layers, 1 RW -> Diff

• Limitations
• 42 layers

• Whiteouts
• Deletion management
Images
• Image format
• Payload (layer)
• Metadata (parent id)

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

• Future
• Backend interface / Devicemapper
• Unified image format: whiteouts (.wh.)
1.
2.
3.
4.

Isolation
Images
Process Management
Roadmap
Process Management
• Docker daemon
• Transports unix/tcp

docker run internals
• Attach logic
• Logs

• Host Integration
• Dockerfile
• RUN
• EXPOSE
• What is the Context?

• Service Discovery
Process Management
• Docker daemon
• Transports: docker –d –H tcp://127.0.0.1:4243 –H unix:///var/run/docker.sock
• Holds all containers
• Handles the logging

• Docker client
• Everything uses the Remote API
Process Management
docker run
• Create
• Start
• Attach

internals

• General Config vs Host Config
• Attach protocol
• TTY
• Non-TTY
1.
2.
3.
4.

Isolation
Images
Process Management
Roadmap
Roadmap
• Docker 0.7
• File system backend interface

• Docker 0.8
• Isolation backend interface
• Full introspection

• Future
• Ambassador Pattern
Conclusion
• Wide global support with backend interfaces
• Service discovery improvement
• Road to multi host / orchestration
Thank you!

www.docker.io

Docker Internals - Twilio talk November 14th, 2013