You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Volume mount doesn't work on a Mac in /tmp/ directory #1039
web_1 | python: can't open file 'app.py': [Errno 2] No such file or directory
On a Mac, /tmp/ is actually in /private/tmp/.
If i move the underlying /tmp/composetest to any other location (ie /Users/toli/dev/composetest), the example works without any changes.
When you say on a Mac you mean Boot2Docker, right? If so, then, your Docker host is the Boot2Docker virtual machine, not your Mac. Volumes are on the host. Volumes within /Users usually work because modern Boot2Docker creates a share between the Mac and the Docker host at the same path.
But /tmp is harder, because it is needed by the VM OS itself, and it is permissions-sensitive, so you can't simply share it with the VM.
The problem here is that docker-compose silently fails (and mounts an empty volume!) instead of giving an error. It took me a few hours to figure this out. This issue should be re-opened.
Reacted by Stepan Leibo, salaev-privo, jcapogna, Paul Makepeace, denja, Jemma Stachelek, Simon Katz, Mihail Russu and kneerunjun
I've experienced the same issue. That docker silently mounts empty volumes when trying to use paths from /tmp/. There are two issues with this for me:
That docker does something else instead, silently, without giving an error message.
That I cannot mount from /tmp/. I know the implications, but I wanted to make /tmp/.X11-unix/X0 available to a container, and that I can't, means I have to use --net=host instead, and I'm not sure whether that's any better than -v /tmp/.X11-unix/.
Reacted by Paul Makepeace, Alexander Altshuler, Asbjørn Ulsberg, denja, Bal Krishna Jha, ilannn and Simon Katz
I agree with @j2kun. Is there a good reason why this fails silently?
I just wasted a few hours debugging trying to mount a file in /tmp while doing development on my Mac. It would have been a lot more obvious if the docker mount actually failed and logged something.
Reacted by Jeremy Kun, Paul Makepeace, Alexander Altshuler, Asbjørn Ulsberg, denja, sebagr, Jemma Stachelek, Big P, Bal Krishna Jha, ilannn and 5 more
Activity
kojiromike commentedon Feb 28, 2015
When you say on a Mac you mean Boot2Docker, right? If so, then, your Docker host is the Boot2Docker virtual machine, not your Mac. Volumes are on the host. Volumes within
/Usersusually work because modern Boot2Docker creates a share between the Mac and the Docker host at the same path.But
/tmpis harder, because it is needed by the VM OS itself, and it is permissions-sensitive, so you can't simply share it with the VM.toli commentedon Mar 4, 2015
ah, seems like use error. thanks
j2kun commentedon Jun 1, 2016
The problem here is that docker-compose silently fails (and mounts an empty volume!) instead of giving an error. It took me a few hours to figure this out. This issue should be re-opened.
salaev-privo commentedon Nov 14, 2017
Stuck with the same issue on Linux - can't map directory in /tmp
christianhujer commentedon Aug 11, 2018
I've experienced the same issue. That docker silently mounts empty volumes when trying to use paths from
/tmp/. There are two issues with this for me:/tmp/. I know the implications, but I wanted to make/tmp/.X11-unix/X0available to a container, and that I can't, means I have to use--net=hostinstead, and I'm not sure whether that's any better than-v /tmp/.X11-unix/.jcapogna commentedon Jan 1, 2019
I agree with @j2kun. Is there a good reason why this fails silently?
I just wasted a few hours debugging trying to mount a file in /tmp while doing development on my Mac. It would have been a lot more obvious if the docker mount actually failed and logged something.
Merge pull request docker#1039 from roidelapluie/update-common