✦ For everyone, free.

Practical knowledge for real and everyday life

Home

8.3.2.5 Cross Platform FS Cost

A focused guide to Cross Platform FS Cost, connecting core concepts with practical Docker and container operations.

Cross-platform filesystem cost refers to the additional performance overhead bind mounts can introduce on Docker Desktop for Mac and Windows, where filesystem access crosses a virtualization boundary between the host operating system and the Linux virtual machine actually running Docker.

Why This Overhead Exists

On native Linux, Docker runs directly on the host's own kernel, and a bind mount involves no virtualization boundary at all; on Mac and Windows, Docker Desktop runs inside a lightweight Linux virtual machine, meaning a bind mount's file access must cross between the host operating system and that VM.

docker run -d -v $(pwd):/app -p 3000:3000 node:20-alpine npm run dev

On Mac or Windows, file operations against this bind mount incur additional overhead from crossing this virtualization boundary, compared to the equivalent operation on native Linux.

Where This Cost Is Most Noticeable

Workloads involving many small file operations — certain JavaScript build tools watching thousands of individual files, for instance — tend to experience this overhead more noticeably than workloads with fewer, larger file operations.

time docker exec myapp npm run build

Comparing build times between native Linux and Docker Desktop for Mac or Windows, for an identical project, often reveals a meaningful difference attributable to this specific overhead.

Mitigations Available on Docker Desktop

Modern versions of Docker Desktop have introduced various optimizations (such as VirtioFS on Mac) specifically to reduce this overhead, generally making it less pronounced than in earlier Docker Desktop versions.

docker run -d -v $(pwd):/app:delegated myapp:1.0

Certain consistency options can also help, though their relevance has diminished somewhat as Docker Desktop's underlying filesystem performance has improved over time.

Why Understanding This Cost Matters

Recognizing that bind mount performance can differ meaningfully between native Linux and Docker Desktop on Mac or Windows helps set realistic performance expectations, and explains why a development workflow that feels snappy on one platform might feel noticeably slower on another, despite using an identical configuration.