NOTE: This is a duplicate of https://github.com/docker/for-mac/issues/2141#issuecomment-337323903
but adding here if needed.
This issue has started for me in the last day for no apparent reason. I did
update to the latest Docker this week but problems did not occur directly
afterward. Still happens after fresh shut down and start (mostly).
Version 17.09.0-ce-mac35 (19611) Channel: stable a98b7c1b7c
macOS 10.12.6 (16G29)
I have a strong feeling that it is related to mounted volumes, but I’ve not been able to prove 100%.
UPDATE: I created an A/B test to replicate using a repo with README:
This includes full information as request here: https://docs.docker.com/docker-for-mac/osxfs/#performance-issues-solutions-and-roadmap
in section “WHAT YOU CAN DO”
My results using these benchmarks:
Bundled and app copied Docker image:
docker run --rm -it $DOCKER_REPO/derailed /bin/bash -l -c "time bundle exec rails r 'Rails.env'"
Base Ruby image, mounting app:
docker run --rm -it -w /derailed -v $(pwd):/derailed $DOCKER_REPO/derailed-dev /bin/bash -l -c "export BUNDLE_PATH=vendor/bundle-docker && bundle exec rake db:schema:load && time bundle exec rails r 'Rails.env'"
UPDATE2: I executed Docker Performance Testbench
delegated: drush site install 3x
delegated: drush cr 3x
cached: drush site install 3x
cached: drush cr 3x
consistent: drush site install 3x
consistent: drush cr 3x