Last active
January 19, 2023 07:17
-
-
Save lox/0f3d6bba94ff10fade5bea6809c8a3b5 to your computer and use it in GitHub Desktop.
Tweak flush and sync settings for Docker for Mac
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/bash | |
set -euo pipefail | |
# via https://github.com/docker/for-mac/issues/668#issuecomment-284028148 | |
cd ~/Library/Containers/com.docker.docker/Data/database | |
git config --global user.useconfigonly false | |
git reset --hard > /dev/null | |
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 | |
echo | |
echo "Current docker settings" | |
echo "-----------------------" | |
echo "full-sync-on-flush: $(cat ./com.docker.driver.amd64-linux/disk/full-sync-on-flush)" | |
echo "on-flush: $(cat ./com.docker.driver.amd64-linux/disk/on-flush)" | |
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 | |
if ! git diff --cached --exit-code ; then | |
echo | |
echo "NEW docker settings" | |
echo "-----------------------" | |
echo "full-sync-on-flush: $(cat ./com.docker.driver.amd64-linux/disk/full-sync-on-flush)" | |
echo "on-flush: $(cat ./com.docker.driver.amd64-linux/disk/on-flush)" | |
echo | |
git commit -s -m "Disable flushing" > /dev/null | |
echo "Docker should restart by itself now." | |
else | |
echo | |
echo "No changes were made" | |
fi |
Author
lox
commented
Apr 10, 2017
•
cd ~/Library/Containers/com.docker.docker/Data/database/
There isn't database folder for me, only ~/Library/Containers/com.docker.docker/Data/
Any ideas? using Docker for mac Version 18.03.0-ce-mac60 (23751)
~/Library/Containers/com.docker.docker/Data/database/
is missing because it is no longer used.
Does it mean there is no way or no need to disable full sync on flush anymore?
What should the users of newest docker do to have MySQL to be at lease tolerable?…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment