<p>Docker on MacOS runs on a virtual machine (docker-machine), and it's known that docker-machine volume mounts may perform worse than what you'd expect. It becomes worse especially when it comes operations concerning lots of small files, like scanning the filesystem.</p>

<p>Official Docker documentation also mentions this, and suggests some workarounds by lowering the consistency guarantees.</p>

<p>See: <a href="https://docs.docker.com/docker-for-mac/osxfs-caching/" rel="nofollow noreferrer">https://docs.docker.com/docker-for-mac/osxfs-caching/</a></p>

CC BY-SA 4.0
2018-07-08T17:02:09.277Z
2018-07-08T17:02:09.277Z
Yekta Leblebici
<p>Is scanning/searching the filesystem slower in a Docker container, than on the host? Seems a lot slower from my testing and sometimes I get an EIO scan error.</p>

<p>Specifically I am scanning a read-only (:ro) shared volume.</p>

<p>In this case, the workaround is I can the host first before sharing the volume in the container, it seems much faster.</p>

<p>Any other workarounds? Is my observation imagined or real?</p>

<p>I am running Docker version <code>18.03.1-ce, build 9ee9f40</code></p>

<p>on MacOS Sierra</p>

CC BY-SA 4.0
2018-05-18T21:02:46.093Z
What OS do you use?
030
CC BY-SA 4.0
2018-05-18T21:23:30.080Z
I am on MacOS Sierra in this case
Alexander Mills
CC BY-SA 4.0
2018-05-18T21:23:57.927Z
running Docker version: `18.03.1-ce, build 9ee9f40`
Alexander Mills
<docker><docker-compose><dockerfile>
Scanning fs in a Docker container is (much) slower than on host?
Alexander Mills
# Scanning fs in a Docker container is (much) slower than on host?

(Asked by: username_0 on 2018-05-18)

Is scanning/searching the filesystem slower in a Docker container, than on the host? Seems a lot slower from my testing and sometimes I get an EIO scan error.

Specifically I am scanning a read-only (:ro) shared volume.

In this case, the workaround is I can the host first before sharing the volume in the container, it seems much faster.

Any other workarounds? Is my observation imagined or real?

I am running Docker version `18.03.1-ce, build 9ee9f40`

on MacOS Sierra

**Tags:** docker, docker-compose, dockerfile

> **Comments:**
> **username_1**: What OS do you use?  
> **username_0**: I am on MacOS Sierra in this case  
> **username_0**: running Docker version: `18.03.1-ce, build 9ee9f40`  

---

## 1 answers

### Answer by username_2 on 2018-07-08. Score: 3 | Accepted answer

Docker on MacOS runs on a virtual machine (docker-machine), and it's known that docker-machine volume mounts may perform worse than what you'd expect. It becomes worse especially when it comes operations concerning lots of small files, like scanning the filesystem.

Official Docker documentation also mentions this, and suggests some workarounds by lowering the consistency guarantees.

See: <https://docs.docker.com/docker-for-mac/osxfs-caching/>


---

