Contents

Docker Volume Mounts Tuning for Mac

Docker Volume Mount Performance Issue on Mac

Issue
There’s a performance issue on Mac.
In my case, the docker.hyperkit process is using high cpu resources.
You’d better use cached configuration in conclusion.

Tuning Configuration

ConfigurationDescription
delegatedThe container’s view of file system writes performed by containers my not be immediately reflect on the host file system.
cachedThe cached configuration provides all the guarantees of the delegated configuration, and some additional guarantees around the visibility of writes performed by containers.
consistentThis is default. The container and host are always synchronizing.

Examples

Volume Mount with Default Configuration as consistent

1
docker run -v /host/data/:/var/lib/mysql mariadb:latest

Volume Mount with delegated

1
docker run -v /host/data/:/var/lib/mysql:delegated mariadb:latest

Volume Mount with cached

1
docker run -v /host/data/:/var/lib/mysql:cached mariadb:latest