(Submitted this via email, but since reports are happening on the forum now, I’m sharing here as well!)
File access in volumes should be comparable to access times in non-volumes, similarly to Linux installations of docker, or docker on mac via docker-machine and VirtualBox.
File access in volumes is many times slower than on non-volumes.
OS X: version 10.11.4 (build: 15E65) Docker.app: version v1.10.3-beta5 Running diagnostic tests: [OK] docker-cli [OK] Moby booted [OK] driver.amd64-linux [OK] vmnetd [OK] lofs [OK] osxfs [OK] db [OK] slirp [OK] menubar [OK] environment [OK] Docker [OK] VT-x Docker logs are being collected into /tmp/20160330-152200.tar.gz. Your unique id in bugsnag is: 4D76F500-A6CA-45D2-B18A-ABFFBF17071E Please quote this in all correspondence.
See steps to reproduce for the simplest use case. The impact is that my team’s testing workflow involves, rather than building a new container via docker-compose for testing, simply running the node:4 container and mounting the current working directory as a volume and running tests. Executing common JS build tools like eslint, babel, and istanbul take an infeasibly long time compared to how quickly it ran using docker-machine over VirtualBox.
Steps to reproduce the behavior
- Get on the commandline of a lightweight docker container, and mount a volume:
docker run --rm -it -v `pwd`:`pwd` -w `pwd` alpine /bin/sh
- Write a few MB of data to a file on the volume, time it:
time dd if=/dev/zero of=test.dat bs=1024 count=100000
- Notice the time is ~15 seconds, and during the operation the CPU usage of the docker process is 100%. For just over 7MB of data! Now
cd /and run the same command. Notice the time is 0.19 seconds with no measurable CPU spike.