-
Notifications
You must be signed in to change notification settings - Fork 445
Docker for Windows: cannot write on shared volumes #152
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
Comments
The only solution on Docker for Windows is to use a Docker controlled volume, rather than mapping it to your host. And it will still work to share volumes to other containers. (see also, the named volumes conversation here) version: '3.4'
services:
sql:
image: mariadb
env_file: ./secrets.env
domainname: ${DOMAINNAME}
hostname: ${FIRSTNAME}-sql
volumes:
- sql-data:/var/lib/mysql
volumes:
sql-data: |
Thank you, I am still confused about Docker volumes and I didn’t get your point. Now it’s clearer, but will data be maintained if the container is deleted? |
@rahonalab, yes the named volume has a life-cycle independent of the container. If you do |
thank you @yosifkit |
These seem related to docker-on-windows/mac: Because they use virtualbox there is an issue with sharing folders between the host and container. Since the issue seems resolved I'm going to close. |
as already mentioned here #95 , mariadb container on windows cannot write its database files on a shared volume. Here is a snippet of my docker-compose.yaml
The text was updated successfully, but these errors were encountered: