Last active
December 27, 2017 16:36
-
-
Save assimovt/47ffbec52c1870df1b79642d694f0145 to your computer and use it in GitHub Desktop.
Provision Boot2Docker with Convoy volume plugin
This file contains hidden or 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 | |
# This script provisions Boot2Docker with the Convoy volume plugin. | |
# Copy it to /var/lib/boot2docker/bootlocal.sh and make it executable. | |
# It will be run at the end of boot initialisation. | |
# https://github.com/boot2docker/boot2docker/blob/master/doc/FAQ.md | |
RELEASE=v0.4.3 | |
URL=https://github.com/rancher/convoy/releases/download/${RELEASE}/convoy.tar.gz | |
WORK_DIR=/var/lib/boot2docker | |
CONVOY_BASE=/var/lib/docker/convoy | |
CONVOY_ROOT=$CONVOY_BASE/root | |
CONVOY_VOLUMES=$CONVOY_BASE/volumes | |
CONVOY_VOLUME_SIZE=500MB | |
CONVOY_LOG=/var/log/convoy.log | |
CONVOY_RELEASE=$CONVOY_BASE/release.txt | |
if [ ! -d ${CONVOY_BASE} ] || ( ! grep -qx ${RELEASE} ${CONVOY_RELEASE} ) | |
then | |
rm -rf $WORK_DIR/convoy | |
wget -O $WORK_DIR/convoy.tar.gz $URL | |
tar -xzf $WORK_DIR/convoy.tar.gz -C $WORK_DIR | |
rm -rf $WORK_DIR/convoy.tar.gz | |
mkdir -p $CONVOY_ROOT | |
mkdir -p $CONVOY_VOLUMES | |
echo $RELEASE > $CONVOY_RELEASE | |
fi | |
cp $WORK_DIR/convoy/convoy /usr/local/bin/ | |
cp $WORK_DIR/convoy/convoy-pdata_tools /usr/local/bin/ | |
mkdir -p /etc/docker/plugins/ | |
echo "unix:///var/run/convoy/convoy.sock" > /etc/docker/plugins/convoy.spec | |
nohup convoy daemon \ | |
--root=$CONVOY_ROOT \ | |
--log=$CONVOY_LOG \ | |
--drivers vfs \ | |
--driver-opts vfs.path=$CONVOY_VOLUMES \ | |
--driver-opts vfs.defaultvolumesize=$CONVOY_VOLUME_SIZE \ | |
> /dev/null 2>&1 & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"Error": "Illegal default volume size specified"
-CONVOY_VOLUME_SIZE=500MB
+CONVOY_VOLUME_SIZE=500M