Skip to content

Instantly share code, notes, and snippets.

@nicholasodonnell
Last active July 25, 2017 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicholasodonnell/be0ea7a15dd40582902dd533ede8036e to your computer and use it in GitHub Desktop.
Save nicholasodonnell/be0ea7a15dd40582902dd533ede8036e to your computer and use it in GitHub Desktop.
Fixes database taking forever to import problem on Dockerized MySQL (Mac)
#!/bin/bash
set -e
cd ~/Library/Containers/com.docker.docker/Data/database
git reset --hard
mkdir -p ./com.docker.driver.amd64-linux/disk
touch ./com.docker.driver.amd64-linux/disk/full-sync-on-flush
touch ./com.docker.driver.amd64-linux/disk/on-flush
echo -n "Current full-sync-on-flush setting: "
cat ./com.docker.driver.amd64-linux/disk/full-sync-on-flush
echo
echo -n "Current on-flush setting: "
cat ./com.docker.driver.amd64-linux/disk/on-flush
echo
echo -n false > ./com.docker.driver.amd64-linux/disk/full-sync-on-flush
echo -n none > ./com.docker.driver.amd64-linux/disk/on-flush
git add ./com.docker.driver.amd64-linux/disk/full-sync-on-flush
git add ./com.docker.driver.amd64-linux/disk/on-flush
git commit -s -m "disable flushing"
echo "Docker should restart by itself now."
osascript -e 'quit app "Docker"'
open -a Docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment