-
Notifications
You must be signed in to change notification settings - Fork 26
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
DevLab in Windows "Invalid bind mount spec" #40
Comments
So the clear issue here is passing Windows pathing into a linux container. To maintain consistency Devlab mounts the volume of your working directory and paths it the same inside the container as it is on the host, so if you're working in My thought is that we could just path statically, i.e. we always have Devlab map to My hesitation here is that error messages that include the path would not be consistent, so if (for instance) a test or linter fails instead of echoing a path, file and line number like I'm not totally against this idea, and it's not a difficult change, however, I'd like to run it by some other people first. If you want to fork and try it out on your system just change this line: - let args = primary ? [ 'run', '--rm', '-it', '-v', `${cwd}:${cwd}`, '-w', cwd, '--privileged' ] : [ 'run', '-d', '--privileged' ]
+ let args = primary ? [ 'run', '--rm', '-it', '-v', `'${cwd}':/app`, '-w', '/app', '--privileged' ] : [ 'run', '-d', '--privileged' ] then just run it from inside your project via |
Getting closer--here's the new output: - docker: Error response from daemon: Invalid bind mount spec "/C/Users/****/server:C:\\Users\\****\\server": invalid mode: \Users\****\server.
+ docker: Error response from daemon: Invalid bind mount spec "'C:\\Users\\****\\server':/app": invalid mode: /app. I can try fiddling with it a bit to see if I can get it to work right. As far as a more permanent solution goes, it does seem like inconsistencies in path/line-number output would be inconvenient--maybe a fix could be implemented specific to Windows paths (even something simple like a path parser and a conditional statement in the same place we're working). |
Just from looking around at similar problems it appears msys is trying to convert those paths, maybe try: let args = primary ? [ 'run', '--rm', '-it', '-v', `'${cwd}':'/app'`, '-w', '/app', '--privileged' ] : [ 'run', '-d', '--privileged' ] |
- docker: Error response from daemon: Invalid bind mount spec "'C:\\Users\\****\\server':/app": invalid mode: /app.
+ docker: Error response from daemon: Invalid bind mount spec "'C:\\Users\\****\\server':'/app'": invalid mode: '/app'. |
well that's not what I was expecting... I'm going to try to nab a Windows system. For the time being, could you try to determine what the
|
Just found this: moby/moby#12751 (comment), maybe try changing it to: let args = primary ? [ 'run', '--rm', '-it', '-v', `'${cwd}'`, '-w', `'${cwd}'`, '--privileged' ] : [ 'run', '-d', '--privileged' ] |
Alright, after a bunch of trial-and-error, I was successful using this at the command line:
Getting the "let args" line right in command.js has been a bit trickier, so I thought I'd report my progress in case you solve it before I do. Turns out the double quotes instead of single quotes on EDIT: when I do console.log(args) after the let args line, this is the output of ${cwd}/app: EDIT2: and EDIT3: Alright @Fluidbyte , this seems to work (comparing to original). Thanks for your help troubleshooting this - let args = primary ? [ 'run', '--rm', '-it', '-v', `${cwd}:${cwd}`, '-w', cwd, '--privileged' ] : [ 'run', '-d', '--privileged' ]
+ let args = primary ? [ 'run', '--rm', '-it', '-v', `${cwd}:/app`, '-w', '/app', '--privileged' ] : [ 'run', '-d', '--privileged' ]
|
Interesting. Let me think about a possible approach to fix this. |
We may be able to mark this as fixed, as of the addition of the @mgleed, are you able to confirm that this takes care of the issue? I don't have a win environment to test, but I think we're safe to close this in absence of more info, as any additional windows-related issues are likely to be different. |
Running Windows 10 Pro, Docker 1.12.5, and DevLab 3.1.1.
I get an error when attempting to start containers with DevLab in Windows (from cmd, git bash, or powershell). I have shared the C: drive.
Here's the output error (personal info substituted with asterisks):
Here's my config file:
I can't tell for sure, but it seems like there is a problem with msys path conversion with docker, but I can't (or don't know how to) control what's passed to docker while using DevLab. I know there are some workarounds recommended with docker (a seemingly related issue) but I'm not sure how I'd implement these suggestions when DevLab is executing the Docker commands. I'm new to DevLab and Docker, so I apologize if I'm way off the mark here.
The text was updated successfully, but these errors were encountered: