Skip to content
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

Path error on Docker for Windows from MINGW #14

Open
rwb27 opened this issue Oct 17, 2017 · 4 comments
Open

Path error on Docker for Windows from MINGW #14

rwb27 opened this issue Oct 17, 2017 · 4 comments

Comments

@rwb27
Copy link

rwb27 commented Oct 17, 2017

I like to run my things from Bash on Windows, and mingw is a convenient way to do this. However, the dockercmd.sh script fails when used this way, with an error:
invalid mount config for type "bind": invalid mount path:
The reason for this is that mingw makes the results of pwd look unix-ey by converting the standard Windows C:\ into /c/ which, in turn, confuses Docker for Windows. The attached bash script fixes that using sed. It's not beautiful, but it works for me. I don't know if there is a reliable way to detect this issue and use the workaround automatically, but I thought I'd share it in the event that others have the problem.

I have to say, latex in Docker is fab - it has saved me a great deal of faffing around today!

I can't upload the script but I've made a gist and pasted the line below:

#!/bin/bash
docker run --rm -i --net=none -v "`pwd | sed -E 's/^\/(.)\//\1:\//'`":/data blang/latex "$@"

(I didn't seem to need the user stuff on Windows - and I'm not sure what the purpose is of the exec but that's probably just my ignorance...)

@blang
Copy link
Owner

blang commented Oct 20, 2017

Thanks for sharing your solution.
I don't have windows available for tests, but i'm sure someone might have the same issue to investigate this further.

@rwb27
Copy link
Author

rwb27 commented Oct 20, 2017

no worries - after a little more reading I suspect I might be able to put something together that uses the results of uname -s to tell whether it's running in mingw, and execute one line or the other accordingly. I'm happy to try to put that in a pull request if it's helpful - but given that you don't have a system to test it on, perhaps it's best just to leave this workaround in a (closed?) issue...

@blang
Copy link
Owner

blang commented Oct 20, 2017

I think an additional script like dockercmd_mingw.sh would be sufficient. I'll keep this open in case anyone wants to collaborate and verify the workaround

@rwb27
Copy link
Author

rwb27 commented Oct 20, 2017

sure. I updated https://gist.github.com/rwb27/9074ac87cac705eb70d390447690b25f to switch automatically, but I agree a separate script might be easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants