2

I have a dev Docker container on OSX with boot2docker.

I connect to the container and mount my project's source directory in the docker container via...

docker run -it -p 8080:8080 -v /local_src:/container_src foo/bar /bin/bash

When inside of the container_src certain operations are very slow. For example, git status takes about 8 seconds to complete.

However, it all works fine if I use source that's cloned into the container

Any ideas as to why this would be?

I'm wondering if there's some overhead from a combination of mounting the volume and using boot2docker.

Carter
  • 2,850
  • 9
  • 44
  • 57

1 Answers1

0

(I'm not an expert on this field - just making some conclusion)

Git actually works on collection of small files. When running git status it needs to access files inside .git folder (on one of my repos it's ~150 files) and run lstat() on each files in repo to ensure they're not modified (more info here). Therefore git inside docker must request info about each file (which needs to be transfered to vm). If there is even small overhead on each request (like 100 ms), and you have 8000 files inside git folder and in git - this results in process taking ~8 seconds.

Community
  • 1
  • 1
Esse
  • 3,278
  • 2
  • 21
  • 25