-
Notifications
You must be signed in to change notification settings - Fork 68
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] Volumes within db causes issue's on Windows #1
Comments
Maybe something from this thread can help? docker/compose#4303 |
I've read multile issue's including that one. |
I'm not sure if you already solved the issue, but I am able to get docker-compose to execute correctly on Windows 10 by removing the '.' from the volume. See below.
I read elsewhere that some people had to manually create the volume on Windows 10, as well, but this did the trick for me. |
Hmm i'm sure i would have tried it but yes indeed.. it spins up without any issues! |
With my little knowledge, I think they're stored in the VM. It does look like you can copy volumes between your system and the container as documented here. I hope that helps. :/ |
Yeah that's what i was afraid off.. the idea of the volumes in CJ's example is that it's stored external i believe, so you don't lose the data. After i add some data, turn off the container and spin it up again i lost all my data now :( |
I haven't experienced any data loss after stopping my container, only after shutting Docker off and on. If you seed your data with knex, you won't lose it since it'll be stored in the seed file. Otherwise, you could install Postgres locally. :) |
` services: db: adminer: works for me on win10 pro |
Like this?
|
So while the above does work on windows, it gives me issue's again on my Macbook. I have to prefix the postgres volumes onder db with /. but as you might have guessed.. that breaks it again on windows :) Is there anyway to get something working multi platform? |
Does ownership add to this problem? What do you see when you do $ Ownership of the ./ directory reference in windows should automatically map to the user you are logged in as and running docker-compose with. It may help to be more explicit, though the ownership may not pass through. Docker says docker for windows is for development only, granted, because their volume drivers are only supported on linux. The microsoft workaround is to take ownership using a bit awkward approach: https://docs.microsoft.com/en-us/archive/blogs/stevelasker/configuring-docker-for-windows-volumes |
How do i do So today i update my windows to the latest update that includes wsl2. |
So on line 7 from the
docker-compose
file it says:- ./docker-data/db-data:/var/lib/postgresql/data
This works fine on my Mac but does not on Windows.
It complains about chmod (probabaly because docker is a different user?)
It is not something new perse (see docker-library/postgres#435) and there are many other issue's on git about it.
Being new myself to Docker i tried some stuff but i could not figure it out.
I hope you could tell me how to achieve the same on Windows so i could follow on my Desktop (and not laptop)
The text was updated successfully, but these errors were encountered: