Skip to content

Instantly share code, notes, and snippets.

@jrryjcksn
jrryjcksn / run_with_checkpoints.sh
Created June 9, 2017 14:33
Automatically persist memory state for a Docker container using CRIU
#!/bin/bash
# A bash script that will periodically checkpoint a container, maintaining a maximum of five checkpoints.
# Once five checkpoints have been created, it will periodically replace the oldest checkpoint with a new one.
# Arguments:
# - run_args (a single string containing the arguments to pass to 'docker run')
# - container_name (name of the existing container to run with automatic persistence or name to give to new container)
# - container_image (image to run in the container)
# - container_args (arguments to pass to the service running in the container)
run_args=$1
@jrryjcksn
jrryjcksn / gist:99a4a17fce0a71169be2582123657ad6
Created January 13, 2017 21:21
Error when running stack build with docker
jrj-centos:/tmp/simple> stack build --verbose
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0
2017-01-13 14:20:00.582231: [debug] Checking for project config at: /tmp/simple/stack.yaml
@(Stack/Config.hs:863:9)
2017-01-13 14:20:00.582408: [debug] Loading project config file stack.yaml
@(Stack/Config.hs:881:13)
2017-01-13 14:20:00.587763: [debug] Run process: /usr/bin/docker --version
@(System/Process/Read.hs:306:3)
2017-01-13 14:20:00.607369: [debug] Process finished in 19ms: /usr/bin/docker --version
@(System/Process/Read.hs:306:3)