Commit 61ac6837 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

script to launch a docker daemon over tmpfs (faster ?)

parent f819993d
#!/bin/bash
die()
{
echo "error: $@" >&2
exit 1
}
set -e
vol="`pwd`/data/docker"
. prepare.sh
[ -d "$vol" ] || die "directory $vol not present"
dir="$vol/test-daemon"
pidfile="$dir/docker.pid"
sock="$dir/docker.sock"
graph="$dir/graph"
[ -d "$dir" ] || mkdir "$dir"
mountpoint="`stat -c %m "$dir"`"
if [ "`realpath "$mountpoint"`" != "`realpath "$dir"`" ]
then
echo "mounting tmpfs dir"
sudo mount -t tmpfs tmpfs-docker "$dir"
fi
DOCKER_HOST="unix://$sock"
echo "export DOCKER_HOST='$DOCKER_HOST'"
sudo dockerd \
--graph "$graph" \
--host "$DOCKER_HOST" \
--pidfile "$pidfile" \
-s overlay2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment