-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"not a directory" when using dot in volume path #675
Comments
This error occurs when you are trying to mount a directory to a file. You might consider using |
Any update on this? Still same problem with server version 19.03.5. I have to mount a file into a docker machine path containing a dot,
Error
|
As mentioned above, the error is due to mismatched file types... one side is a dir the other side is a file. Is Closing since this does not look like an issue. |
@cpuguy83 Are you sure this issue does not exist? I have noticed similar behavior for X server passthroughs: For months I have been using
and is thus a file. Just to verify:
(entry would have a trailing slash if it was a directory due to But when I try to mount it now I hit a very similar issue:
When I copy the file to
So while I don't have time to investigate this more profoundly, my impression is that @Nolanus is indeed onto something and that it might be worth it to investigate the issue further. It seems the host file path can contain dots:
works. Also note that I'm on Ubuntu 20.04 and my Docker version is:
|
I'm also getting strange behavior on windows using docker. Basically, the tree looks like:
When I do
|
confirmed on Docker Desktop for MacOS 4.3.0. Was using a sample docker compose file from a downloaded GitHub project that had a directory with dots in the name, and mounted it into a similarly named location. Changed the '.' chars to '_' and the problem went away. Docker reported an error with part of the desired mount not being a directory (even though the source most certainly was). |
I was finally able to narrow it down. If the filename contains exactly three characters after the last dot it is considered a file. If it contains no dot the auto detection still seems to work fine. If it contains any other amount of characters after the last dot, it seems to be considered a directory.
This is extremely annoying and has worked before (not exactly sure since which version it stopped working), but rather recently, like beginning of January. |
I have also found now that if I try to specify the following: |
thank you so much this saved my day!!!! confirmed it was working as late as early February for me and just recently broke. |
Using Docker Desktop ( 4.7.1 (77678) ) with WSL2. Problem persists... |
Problem happening with Docker Desktop and WSL2 + Docker Compose with a .env file
|
Problem still happening; Docker: Error
Compose file
I need to clarify that this runs on a self-hosted GitHub action runner under this path: |
Update: For Windows, first bullet. I verified the fix with temp build at the time. |
This bug is not in Docker Desktop and it is not fixed as of 20.10.18.
|
Same issue here Docker version
|
I confirm this issue for 'Docker version 20.10.22, build 3a2c30b' on a macos |
The solution from @GustavR did not work for me. Another workaround could be to remove the line causing the error and use |
Expected behavior
Mount volume
Actual behavior
Getting error:
Steps to reproduce the behavior
/home/xxx
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.)
The text was updated successfully, but these errors were encountered: