Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
set -e
cd ~/Library/Containers/com.docker.docker/Data/database
git reset --hard
echo -n "Current full-sync-on-flush setting: "
P=~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/disk/full-sync-on-flush
if [ -f $P ]; then
echo "file exists"
else
mkdir -p ~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/disk
touch $P
fi
cat $P
echo
# thats for the d4m edge compat, which no longer has on-flush
if [ -a ~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/disk/on-flush ]; then
echo -n "Current on-flush setting: "
cat ~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/disk/on-flush
echo
echo -n none > ~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/disk/on-flush
git add ./com.docker.driver.amd64-linux/disk/on-flush
fi
touch ~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/disk/full-sync-on-flush
echo -n false > ~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/disk/full-sync-on-flush
cd ~/Library/Containers/com.docker.docker/Data/database
git add ./com.docker.driver.amd64-linux/disk/full-sync-on-flush
git commit -s -m "disable flushing"
echo "Docker should restart by itself now."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment