-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
docker compose volume mounts not work on Windows #4303
Comments
Did you set |
We made a .env file in same directory as docker-compose.yml file and added COMPOSE_CONVERT_WINDOWS_PATHS=1 we have also tried this to be true. but still getting below error. ABHISHEK@WindowsAbhi MINGW64 ~/Desktop/docker/dockerapp-releases/dockerapp-0.4/dockerapp-0.4 ERROR: for dockerapp Cannot create container for service dockerapp: Invalid bind mount spec "C:\Users\ABHISHEK\Desktop\docker\dockerapp-releases\dockerapp-0.4\do |
Is there a better way to do COMPOSE_CONVERT_WINDOWS_PATHS or any other workaround. |
Just type "export COMPOSE_CONVERT_WINDOWS_PATHS=1" and it will work until reboot. |
Any reason this was closed? I've created a system environment variable and tried the .env file but still no avail. |
It's not closed, but that particular issue should be resolved. Make sure your Compose version is up to date and your docker-compose.yml is correct. |
I have the same issue on Windows 10. I use
i can't find app directory inside container.
volumes is working great Is there any solution how to fix this bug in docker-compose? |
One and a half months... is there a solution yet? |
Running Docker 17.06.0-ce-win19 (12801) on Windows 10 using Visual Studio 2017 I ran into this thing. |
Yes, you can. At least on Windows 10. |
@rolandwolters You cannot have a file without a filename in Explorer. But you can open a Powershell, navigate to your project directory and type: mv e.env .env |
If you're still having issues, please make sure your shared drives are configured properly: https://blogs.msdn.microsoft.com/stevelasker/2016/06/14/configuring-docker-for-windows-volumes/ |
It worked for me with |
I've used , in a CMD window, SET COMPOSE_CONVERT_WINDOWS_PATHS=1 and it suddenly starting working. Remember to open a new CMD window. |
I just discovered the "Reset Credentials..." button in the Shared Drive settings, which solved the issue for me. In my case the volume suddenly stopped working after disabling+enabling Hyper-V. Resetting the credentials for the shared drives fixed it again |
@jaspervandaele, thanks a lot, this fixed my issue too. The error message |
@rolandwolters You can bypass the Windows Explorer naming restriction by adding an extra |
@jaspervandaele thanks for that- solved it for me. |
|
@gersondinis there is no option in settings for Shared Drives when Docker CE is running in Windows mode...unless I'm missing something using edge release: |
Try to change from edge version to stable version on Daemon tab. If it doesn't, try to upgrade/update your Docker for Windows. |
@gersondinis Thanks!, that solved my problem! |
@gersondinis latest version of CE and stable version...this is all I get: |
@gersondinis Sir your a life saver! |
Will
|
I was having this issue (at least I think it's the same issue), but since I wanted to keep Hyper-V off in order to use accelerated emulation for Intel + Android, I couldn't use the Docker for Windows GUI app and look for those Shared Drives settings that @shin- mentioned, because I was using docker-machine.exe + VirtualBox. So what I had to do in this particular case instead was this: https://forums.docker.com/t/how-to-share-volumes-and-or-drives-using-docker-machine-on-windows-not-beta/20170/2
And then in
I think this is more like a workaround and not a full solution, but I hope somebody finds it helpful. TL;DR: If you're using VirtualBox and not Docker for Windows, try mounting the drives in VirtualBox with VBoxManage.exe |
I'm using windows subsystem for linux, running the docker-host on the windows machine exposed via non-TLS port 2375. I tried what @stavrogin mentioned, but it did not work.
After running docker-compose up i get " Are you trying to mount a directory onto a file (or vice-versa)"
I tried placing an .env file within the directory
But still cannot start the containers from my Windows machine. Running the exact same configuration on a linode works as is. What am I missing out here? Edit: Moving the repository within the subsystem /home/ben/ea did also not resolve it Edit: I fixed it with changing the Volumes from
to
|
using docker toolbox on windows this way i could solve my the issue docker-compose.yml: version: '3' |
- With long-running hosts, rooting the volumes inside of the git cloned source directory is problematic. When tests are cancelled and containers remain running, files can be locked, preventing subsequent runs from proceeding correctly. Instead, generate a temporary directory in Azure to root the files so that source can be cloned properly. - This removes the need for cleaning up existing hardcoded dirs in Azure from prior test runs - For now this will continue to default to `.` in Travis, given hosts are ephemeral - Additional code will be added to perform cleanup from tests - The Azure specific PowerShell code converts a Windows path like: c:\foo\bar\tmp.foo To something compose understands like: //c/foo/bar/tmp.foo See docker/compose#4303 (comment)
- With long-running hosts, rooting the volumes inside of the git cloned source directory is problematic. When tests are cancelled and containers remain running, files can be locked, preventing subsequent runs from proceeding correctly. Instead, generate a temporary directory in Azure to root the files so that source can be cloned properly. - This removes the need for cleaning up existing hardcoded dirs in Azure from prior test runs - For now this will continue to default to `.` in Travis, given hosts are ephemeral - Additional code will be added to perform cleanup from tests - The Azure specific PowerShell code converts a Windows path like: c:\foo\bar\tmp.foo To something compose understands like: //c/foo/bar/tmp.foo See docker/compose#4303 (comment)
- With long-running hosts, rooting the volumes inside of the git cloned source directory is problematic. When tests are cancelled and containers remain running, files can be locked, preventing subsequent runs from proceeding correctly. Instead, generate a temporary directory in Azure to root the files so that source can be cloned properly. - This removes the need for cleaning up existing hardcoded dirs in Azure from prior test runs - For now this will continue to default to `.` in Travis, given hosts are ephemeral - Additional code will be added to perform cleanup from tests - The Azure specific PowerShell code converts a Windows path like: c:\foo\bar\tmp.foo To something compose understands like: //c/foo/bar/tmp.foo See docker/compose#4303 (comment)
- With long-running hosts, rooting the volumes inside of the git cloned source directory is problematic. When tests are cancelled and containers remain running, files can be locked, preventing subsequent runs from proceeding correctly. Instead, generate a temporary directory (on Windows) to root the files so that source can be cloned properly. - This removes the need for cleaning up existing hardcoded dirs from prior test runs, but we still make a best effort in the Azure job to do cleanup - For now this will continue to default to `.` in Travis, given hosts are ephemeral. On Windows hosts, this will be in the temp dir for the given user. docker-compose understands Windows paths on the left hand side of the volume mapping, so no conversions are necessary. This was not always the case per: docker/compose#4303 (comment) - Stuff the temp dir in an Azure variable so it can be used in a later cleanup stage - Set the temp dir to give Users group full control to prevent the containers from running into permissions issues - Additional code will be added to perform cleanup from tests
- With long-running hosts, rooting the volumes inside of the git cloned source directory is problematic. When tests are cancelled and containers remain running, files can be locked, preventing subsequent runs from proceeding correctly. Instead, generate a temporary directory (on Windows) to root the files so that source can be cloned properly. - This removes the need for cleaning up existing hardcoded dirs from prior test runs, but we still make a best effort in the Azure job to do cleanup - For now this will continue to default to `.` in Travis, given hosts are ephemeral. On Windows hosts, this will be in the temp dir for the given user. docker-compose understands Windows paths on the left hand side of the volume mapping, so no conversions are necessary. This was not always the case per: docker/compose#4303 (comment) - Stuff the temp dir in an Azure variable so it can be used in a later cleanup stage - Set the temp dir to give Users group full control to prevent the containers from running into permissions issues - Additional code will be added to perform cleanup from tests
- With long-running hosts, rooting the volumes inside of the git cloned source directory is problematic. When tests are cancelled and containers remain running, files can be locked, preventing subsequent runs from proceeding correctly. Instead, generate a temporary directory (on Windows) to root the files so that source can be cloned properly. - This removes the need for cleaning up existing hardcoded dirs from prior test runs, but we still make a best effort in the Azure job to do cleanup - For now this will continue to default to `.` in Travis, given hosts are ephemeral. On Windows hosts, this will be in the temp dir for the given user. docker-compose understands Windows paths on the left hand side of the volume mapping, so no conversions are necessary. This was not always the case per: docker/compose#4303 (comment) - Stuff the temp dir in an Azure variable so it can be used in a later cleanup stage - Set the temp dir to give Users group full control to prevent the containers from running into permissions issues - Additional code will be added to perform cleanup from tests
and this COMPOSE_CONVERT_WINDOWS_PATHS=1 Worked for me |
Thank you, it is working. BTW, please keep in mind you should use at least version 3.3 of docker-compose YAML notation. |
This fixed it for me too... |
What about ownership between windows docker host and container users, assuming docker-compose volume mounts correctly, the drivers do not seem to exist to translate ownership. Would we need to chown after each docker-compose up if we wanted to edit the mounted data on windows, for example? |
Can someone elaborate this please? I don't understand where can I find these settings. |
On the latest Docker for Windows GUI these settings are removed, I guess because this version is not supposed to loose credentials |
- With long-running hosts, rooting the volumes inside of the git cloned source directory is problematic. When tests are cancelled and containers remain running, files can be locked, preventing subsequent runs from proceeding correctly. Instead, generate a temporary directory (on Windows) to root the files so that source can be cloned properly. - This removes the need for cleaning up existing hardcoded dirs from prior test runs, but we still make a best effort in the Azure job to do cleanup - For now this will continue to default to `.` in Travis, given hosts are ephemeral. On Windows hosts, this will be in the temp dir for the given user. docker-compose understands Windows paths on the left hand side of the volume mapping, so no conversions are necessary. This was not always the case per: docker/compose#4303 (comment) - Stuff the temp dir in an Azure variable so it can be used in a later cleanup stage - Set the temp dir to give Users group full control to prevent the containers from running into permissions issues - Additional code will be added to perform cleanup from tests
When running docker-compose up, we get this error:
The docker-compose file is attached below
We get the error both on Docker for Windows and Docker toolbox running on Windows.
The text was updated successfully, but these errors were encountered: