-
Notifications
You must be signed in to change notification settings - Fork 607
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
Unable to mount volumes or bind mount on Windows #759
Comments
I would like to make a PR to fix this |
Thanks for taking a look! |
Use instead: -v /bind_volumes/v1:/src |
for reference docker does work with the
|
Hey @textminer, if I use this approach, do you have a recommendation on how to target different windows drive letters? For example, if I wanted to bind-mount "f:\foo\bar", how would I accomplish this using nerdctl? |
@wtfacoconut There is a bug in containerd for different drive letters in Windows: containerd/containerd#6589. Once that is fixed and this parsing error here is fixed, we would be able to support the other driver letters |
Understood. Thanks for the info. |
Looks like containerd/containerd#6589 fixed by containerd v1.6.6 (PR containerd/containerd#6651) |
Get "failed to parse" error message:
|
@kkbruce this won't work, there is a patch in progress at #924 work around is to use |
I've been trying for a long time and can't come up with the alternatives you mentioned. Can you provide a complete Local
Test mount function:
|
I am running nerdctl from gitbash on Windows machine and this command is working for me: |
Any progress on this? I've tried a lot of combinations of path specification. Nothing works. |
Same problem there. I tried in all possible ways but I have to deal with Docker CE yet. Any ETA regarding this issue, or which version will have a fix available? Thanks! |
Any updates ? Thanks |
@AkihiroSuda this is apparently fixed by #2661 so I guess we should close this. |
Issue:
When using nerdctl + containerd on Windows, I am unable to mount volumes or bind mount to a new windows container. I've tried using the following command with no success:
I've also tried experimenting with the the
-v
option, by trying various ways of single/double quoting an escaping special characters, but again I did not have any success.Code Investigation:
Now, I do not know how to program in Go (so please excuse me if I'm totally wrong here). But starting at line 56 in mountutil.go, it looks like that whole switch statement is really only designed to handle Linux paths. I say this because on line 56, the value passed to
-v
is being split on the ":" character and the switch statement doesn't look like it would be able to handle bind mount (eg:-v c:\hostDir:c:\guestDir
) or just mounting volumes to a windows container (eg:-v vol1:c:\guestDir
).Also, line 56's parent function (generateMountOpts), returns back up to run_mount.go on line 195. Just a few lines below that on line 203, it looks like the SecureJoin may encounter issues if a full windows path containing a colon character were to be joined with tempDir on that line.
That's what I've been able to observe to the best of my ability. If I'm overthinking or if I've made some very obvious mistake when trying to use the
-v
option, please let me know.Thanks!
My Environment:
The text was updated successfully, but these errors were encountered: