BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Docker Desktop 4.6 for Mac Boosts Sharing Performance

Docker Desktop 4.6 for Mac Boosts Sharing Performance

This item in japanese

Lire ce contenu en français

Docker Desktop 4.6 for Mac introduces a number of changes that speed up file syncing between the macOS host and Docker VM. According to Docker, the new version may reduce the time taken by file syncing by up to 98%.

Code sharing is one of three approaches Docker Desktop supports for sharing a part of the local file system with a container: bind mount, named volumes, and direct file copy. Each has its own pros and cons, which makes them best suited for different use cases. Bind mounts are the most convenient option to share code that you may need to edit from within the container. Previous to version 4.6, though, Docker warned developers of a performance hit the bind mounts suffered with very large repositories or programs using many external dependencies.

When considering that modern dependency management can easily bring 10k – 100k files into a project (which linearly increases the performance penalty), this can result in poor performance as the host and container keep in sync via the volume.

The changes introduced in version 4.6 include the adoption of virtiofs as an optional replacement for gRPC-FUSE and greatly improve sharing performance.

The goal of virtiofs is to provide local file system semantics between multiple virtual machines sharing a directory tree. This is especially useful for lightweight VMs and container workloads, where shared volumes are a requirement.

Specifically, says Docker, the new version reduces by 80%-90% the time taken by operations such as importing 284MB of data into a MySQL database, running composer install for a large PHP codebase, or launch a monolithic TypeScript app.

As mentioned, virtiofs is not enabled by default, but can be enabled under Docker Desktop experimental features. Virtiofs requires macOS 12.2+ for Apple Silicon and macOS 12.3+ for Intel.

As a final note, interested developers should be aware of a known bug which can make containers running with virtiofs fail due to permission errors. This bug has been fixed in an experimental build you can install in case you need it.

About the Author

Rate this Article

Adoption
Style

BT