Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tmihalicka/708c8126bd9ba32c6cfae140e01fb6ca to your computer and use it in GitHub Desktop.
Save tmihalicka/708c8126bd9ba32c6cfae140e01fb6ca to your computer and use it in GitHub Desktop.
Speedup Docker for Mac (OSX) Beta - Overlay Storage Driver

Speedup Docker for Mac (OSX) Beta

Using Overlay Storage Driver

If you're experiencing performance problem with Docker for Mac (Beta) on your Mac, especially with databases, this tip is for you. AUFS is good storage driver on Linux, but on Mac OS it's performance bottleneck for Docker. Based on this blogpost https://sthbrx.github.io/blog/2015/10/30/docker-just-stop-using-aufs/ I tried to switch storage driver to Overlay, but on Docker for Mac it's little bit tricky thanks to missing Pinata and that's the reason why is this gist here.

Performance impact is huge, I managed to reduce the time for importing 1,5GB table into MariaDB from 1 hour to 10 minutes just with switching storage driver to Overlay.

WARNING: You should backup all data from AUFS storage, because of storage driver change, Docker will start everything from scratch.

Note: We're turning off debug mode to get even more performance. If you're experiencing any issues leave it on.

Steps to set new storage driver (use Terminal, administrator rights are not necessary):

  1. cd ~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux
  2. echo '{"storage-driver":"overlay","dns":["8.8.8.8"],"insecure-registries":["docker.local:5000"],"debug":false}' > etc/docker/daemon.json
  3. git add etc/docker/daemon.json
  4. git commit -m 'etc/docker/daemon.json change'
  5. now quit Docker for Mac and rerun it

To make sure everything is set check docker info for Storage Driver: overlay

#!/bin/bash
cd ~/Library/Containers/com.docker.docker/Data/database
mkdir -p com.docker.driver.amd64-linux/etc/docker
echo '{"storage-driver":"overlay","dns":["8.8.8.8"],"insecure-registries":["docker.local:5000"],"debug":false}' > com.docker.driver.amd64-linux/etc/docker/daemon.json
git add *
git commit -m 'etc/docker/daemon.json change'
echo -e "\033[33;31m Now please exit Docker for OSX and rerun it.\033[0m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment