SlideShare a Scribd company logo
Cloning Running Servers
Ross
Boucher
@boucher
Cloning Running Servers with Docker and CRIU by Ross Boucher
$ node
>> 2 + 2
4
>>
Browser Server
2 + 2
4
x = 1
1
++x
2
x == 2
true
[1]
[2]
[3]
x = 1
1
++x
2
x == 2
true
[4]
[2]
[3]
Cloning Running Servers with Docker and CRIU by Ross Boucher
(Checkpoint Restore In Userspace)
CRIU
CRIU
+
Application
Server
Evaluation
Controller
Public Internet Internal Network Isolated Network
Container PoolUser’s Browser
Primary Docker Eval Docker
2 + 2
4
message: "evaluate"
nodeVersion: "4.x.x"
sources: [{
type: "source",
text: "var x = 2 + 2",
checksum: "a8efd"
}]
url: "/users/boucher/repositories/12345/branches/master"
2 + 2 Application
Server
message: "get-evaluator"
nodeVersion: "4.x.x"
checksums: [ "a8efd" ]
url: "/users/boucher/repositories/12345/branches/master"
2 + 2
Evaluation
Controller
Application
Server
function get_evaluator(configuration) {
if (cached_containers[configuration]) {
return cached_containers[configuration]
}
if (checkpoint_exists(configuration)) {
return restored_container(configuration);
}
return pooled_container(configuration)
}
2 + 2
Evaluation
Controller
message: "found-evaluator"
IP: "172.0.1.201"
port: "7777"
Evaluation
Controller
Application
Server
message: "establish-connection"
message: "get-source"
index: 0
message: "source-at-index"
index: 0
source: "var x = 2+2;"
message: "output"
value: 4
Application
Server
message: "output"
index: 0
value: 4
2 + 2 Application
Server4
message: "checkpoint-evaluator"
checksum: "a8efd"
url: "/users/boucher/repositories/12345/branches/master"
2 + 2
Evaluation
Controller
Application
Server
await container.checkpoint({
LeaveRunning: true,
ImagesDirectory: “/checkpoints/<document_id>/<checksum>/”
})
if (await container.changes().length > 0) {
metadata.image = await container.commit({ pause: false })
}
await fs.writeFile(metadata,
“/checkpoints/<document_id>/<checksum>/metadata.txt”)
2 + 2Evaluation
Controller
# current cli
$ docker checkpoint --leave-running --image-dir=/checkpoint/path
<container_id>
$ docker commit --pause=false <container_id>
# new cli
$ docker checkpoint --exit=false <container_id> <checkpoint_id>
2 + 2Evaluation
Controller
message: "get-source"
...
message: "source-at-index"
...
message: "finished"
(process exited)
Application
Server
message: "predict-evaluator"
checksums: [ "a8efd" ]
url: "/users/boucher/repositories/12345/branches/master"
2 + 2
Evaluation
Controller
Application
Server
function predict_evaluator(configuration) {
var cpPath = “/checkpoints/<document_id>/<checksum>/”;
var metadata = await fs.readFile(metadata, cpPath + “/metadata.txt”);
var container = await docker.restore({
ImagesDirectory: cpPath
...
});
cached_containers[configuration] = container;
}
2 + 2Evaluation
Controller
$ docker create tonic/worker
<container_id>
# current cli
$ docker restore --force —image-dir=/checkpoint/path <container_id>
# new cli
$ docker start --checkpoint <checkpoint_id> <container_id>
2 + 2Evaluation
Controller
message: "evaluate"
nodeVersion: "4.x.x"
sources: [
{ type: "source", text: "var x = 2 + 2", checksum: "a8fed"},
{ type: "source", text: "x++", checksum: "b9ccc" }
]
url: "/users/boucher/repositories/12345/branches/master"
Application
Server
2 + 2
4
x++
function get_evaluator(configuration) {
if (cached_containers[configuration]) {
return cached_containers[configuration]
}
if (checkpoint_exists(configuration)) {
return restored_container(configuration);
}
return pooled_container(configuration)
}
2 + 2
Evaluation
Controller
• Drop any capabilities you don’t need
• Set CPU, memory, and network constraints
• User Namespaces
• Network Isolation
• Seccomp
Security Concerns
• AUFS errors
• CRIU failures
• Race conditions
• Zombie processes
• Docker daemon restarts
• Filesystem management
Security Concerns
github.com/boucher/dockworker
DockWorker
Cloning Running Servers with Docker and CRIU by Ross Boucher
Cloning Running Servers with Docker and CRIU by Ross Boucher
(and other potential use cases)
Container Migration
! Pre-compiled Release (based on Docker 1.10)
! Checkpoint/Restore Pull Request
! Saied Kazemi’s Linux Plumber’s Talk
! CRIU Homepage
! DockerCon Doom Demo
! Tonic Blog on checkpoint/restore
! DockWorker on Github
! Using P.Haul with Docker
! DockerScript is a cool tool we use to manage our images
Further Reading
Thanks!
@boucher • rboucher@gmail.com

More Related Content

PPTX
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
PDF
Online Meetup: Why should container system / platform builders care about con...
PPTX
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
PDF
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
PDF
Monitoring Containers at New Relic by Sean Kane
PDF
Docker Security Deep Dive by Ying Li and David Lawrence
PDF
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
PDF
runC: The little engine that could (run Docker containers) by Docker Captain ...
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Online Meetup: Why should container system / platform builders care about con...
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
Monitoring Containers at New Relic by Sean Kane
Docker Security Deep Dive by Ying Li and David Lawrence
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
runC: The little engine that could (run Docker containers) by Docker Captain ...

What's hot (20)

PPTX
Docker for Fun and Profit
PDF
ContainerDayVietnam2016: Django Development with Docker
PDF
Monitoring Dell Infrastructure using Docker & Microservices
PDF
Dockercon 16 Wrap-up (Docker for Mac and Win, Docker 1.12, Swarm Mode, etc.)
PDF
Scaling docker with kubernetes
PPTX
Docker Security workshop slides
PPTX
virtualization-vs-containerization-paas
PDF
Docker up and running
PDF
The state of the swarm
PPTX
Scaling Docker Containers using Kubernetes and Azure Container Service
PPTX
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
PDF
Docker Distributed application bundle & Stack - Overview
PDF
What's New in Docker 1.12?
PDF
Docker Online Meetup: Infrakit update and Q&A
PDF
Troubleshooting Tips from a Docker Support Engineer
PDF
Docker Online Meetup #28: Production-Ready Docker Swarm
PPTX
Docker practical solutions
PDF
Container Days Boston - Kubernetes in production
PDF
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
PDF
Kubernetes - Sailing a Sea of Containers
Docker for Fun and Profit
ContainerDayVietnam2016: Django Development with Docker
Monitoring Dell Infrastructure using Docker & Microservices
Dockercon 16 Wrap-up (Docker for Mac and Win, Docker 1.12, Swarm Mode, etc.)
Scaling docker with kubernetes
Docker Security workshop slides
virtualization-vs-containerization-paas
Docker up and running
The state of the swarm
Scaling Docker Containers using Kubernetes and Azure Container Service
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Docker Distributed application bundle & Stack - Overview
What's New in Docker 1.12?
Docker Online Meetup: Infrakit update and Q&A
Troubleshooting Tips from a Docker Support Engineer
Docker Online Meetup #28: Production-Ready Docker Swarm
Docker practical solutions
Container Days Boston - Kubernetes in production
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
Kubernetes - Sailing a Sea of Containers
Ad

Viewers also liked (20)

PDF
Getting Deep on Orchestration: APIs, Actors, and Abstractions in a Distribute...
PDF
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
PDF
Unikernels and docker from revolution to evolution — unikernels and docker ...
PDF
Sharding Containers: Make Go Apps Computer-Friendly Again by Andrey Sibiryov
PDF
Docker for Mac and Windows: The Insider's Guide by Justin Cormack
PDF
Containerd: Building a Container Supervisor by Michael Crosby
PDF
Docker Container Checkpoint and Restore with CRIU
PDF
Advanced Docker Developer Workflows on MacOS X and Windows
PPTX
Dockerizing WordPress
PPTX
DockerCon SF 2015: Education for a digital world
PPTX
DockerCon SF 2015: How to talk to humans
PDF
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
PDF
DockerCon SF 2015: DHE/DTR
PDF
Docker Online Meetup #3: Docker in Production
PDF
Docker Links
PDF
Everything You Need to Know About Docker and Storage by Ryan Wallner, ClusterHQ
PDF
Victor Vieux at Docker Paris Meetup #1
PDF
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaS
PDF
How to Successfully Build a Local Docker Community by Mathias Renner
PPTX
Docker at RelateIQ
Getting Deep on Orchestration: APIs, Actors, and Abstractions in a Distribute...
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
Unikernels and docker from revolution to evolution — unikernels and docker ...
Sharding Containers: Make Go Apps Computer-Friendly Again by Andrey Sibiryov
Docker for Mac and Windows: The Insider's Guide by Justin Cormack
Containerd: Building a Container Supervisor by Michael Crosby
Docker Container Checkpoint and Restore with CRIU
Advanced Docker Developer Workflows on MacOS X and Windows
Dockerizing WordPress
DockerCon SF 2015: Education for a digital world
DockerCon SF 2015: How to talk to humans
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
DockerCon SF 2015: DHE/DTR
Docker Online Meetup #3: Docker in Production
Docker Links
Everything You Need to Know About Docker and Storage by Ryan Wallner, ClusterHQ
Victor Vieux at Docker Paris Meetup #1
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaS
How to Successfully Build a Local Docker Community by Mathias Renner
Docker at RelateIQ
Ad

Similar to Cloning Running Servers with Docker and CRIU by Ross Boucher (20)

PDF
Cutting through the fog of cloud
PDF
Symfony2 from the Trenches
PDF
Symfony2 - from the trenches
PDF
Burn down the silos! Helping dev and ops gel on high availability websites
PDF
TriHUG 2/14: Apache Sentry
PDF
Do you know what your drupal is doing? Observe it!
PDF
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
PPTX
Hyperledger Besu 빨리 따라하기 (Private Networks)
PDF
FleetDB: A Schema-Free Database in Clojure
PDF
Artem Zhurbila - docker clusters (solit 2015)
PPTX
Unit test candidate solutions
PPTX
Deploying windows containers with kubernetes
PDF
Store and Process Big Data with Hadoop and Cassandra
PPTX
Docker 1.11 Presentation
PDF
Infrastructure-as-code: bridging the gap between Devs and Ops
PDF
FleetDB A Schema-Free Database in Clojure
PDF
Microservices blue-green-deployment-with-docker
PDF
OSMC 2011 | Case Study - Icinga at Hyves.nl by Jeffrey Lensen
PDF
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
PDF
IR Journal (itscholar.codegency.co.in).pdf
Cutting through the fog of cloud
Symfony2 from the Trenches
Symfony2 - from the trenches
Burn down the silos! Helping dev and ops gel on high availability websites
TriHUG 2/14: Apache Sentry
Do you know what your drupal is doing? Observe it!
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
Hyperledger Besu 빨리 따라하기 (Private Networks)
FleetDB: A Schema-Free Database in Clojure
Artem Zhurbila - docker clusters (solit 2015)
Unit test candidate solutions
Deploying windows containers with kubernetes
Store and Process Big Data with Hadoop and Cassandra
Docker 1.11 Presentation
Infrastructure-as-code: bridging the gap between Devs and Ops
FleetDB A Schema-Free Database in Clojure
Microservices blue-green-deployment-with-docker
OSMC 2011 | Case Study - Icinga at Hyves.nl by Jeffrey Lensen
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
IR Journal (itscholar.codegency.co.in).pdf

More from Docker, Inc. (20)

PDF
Containerize Your Game Server for the Best Multiplayer Experience
PDF
How to Improve Your Image Builds Using Advance Docker Build
PDF
Build & Deploy Multi-Container Applications to AWS
PDF
Securing Your Containerized Applications with NGINX
PDF
How To Build and Run Node Apps with Docker and Compose
PDF
Hands-on Helm
PDF
Distributed Deep Learning with Docker at Salesforce
PDF
The First 10M Pulls: Building The Official Curl Image for Docker Hub
PDF
Monitoring in a Microservices World
PDF
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
PDF
Predicting Space Weather with Docker
PDF
Become a Docker Power User With Microsoft Visual Studio Code
PDF
How to Use Mirroring and Caching to Optimize your Container Registry
PDF
Monolithic to Microservices + Docker = SDLC on Steroids!
PDF
Kubernetes at Datadog Scale
PDF
Labels, Labels, Labels
PDF
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
PDF
Build & Deploy Multi-Container Applications to AWS
PDF
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
PDF
Developing with Docker for the Arm Architecture
Containerize Your Game Server for the Best Multiplayer Experience
How to Improve Your Image Builds Using Advance Docker Build
Build & Deploy Multi-Container Applications to AWS
Securing Your Containerized Applications with NGINX
How To Build and Run Node Apps with Docker and Compose
Hands-on Helm
Distributed Deep Learning with Docker at Salesforce
The First 10M Pulls: Building The Official Curl Image for Docker Hub
Monitoring in a Microservices World
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
Predicting Space Weather with Docker
Become a Docker Power User With Microsoft Visual Studio Code
How to Use Mirroring and Caching to Optimize your Container Registry
Monolithic to Microservices + Docker = SDLC on Steroids!
Kubernetes at Datadog Scale
Labels, Labels, Labels
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Build & Deploy Multi-Container Applications to AWS
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
Developing with Docker for the Arm Architecture

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Encapsulation theory and applications.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
Teaching material agriculture food technology
PPTX
MYSQL Presentation for SQL database connectivity
MIND Revenue Release Quarter 2 2025 Press Release
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Empathic Computing: Creating Shared Understanding
Advanced methodologies resolving dimensionality complications for autism neur...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Digital-Transformation-Roadmap-for-Companies.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Big Data Technologies - Introduction.pptx
Review of recent advances in non-invasive hemoglobin estimation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Encapsulation theory and applications.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Teaching material agriculture food technology
MYSQL Presentation for SQL database connectivity

Cloning Running Servers with Docker and CRIU by Ross Boucher