Created
September 20, 2016 18:38
-
-
Save dmcgowan/a64d67a6ac067f40598a3ce9473c0823 to your computer and use it in GitHub Desktop.
Script to test https://github.com/docker/docker/pull/24771
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
tmpdir=$(mktemp -d) | |
volume=$1 | |
shift | |
if [ ! -f $volume ]; then | |
fallocate -l 512M $volume | |
fi | |
device=$(losetup -f --show $volume) | |
mkfs.xfs -f $device | |
mount $device $tmpdir $@ | |
# Show mount | |
mount | grep $tmpdir | |
function cleanup() { | |
sleep 1 | |
umount -rf $tmpdir | |
losetup -d $device | |
rmdir $tmpdir | |
} | |
trap cleanup EXIT | |
docker daemon -D -s overlay2 -g $tmpdir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment