W
W
wideShift2021-09-18 12:22:44
Windows
wideShift, 2021-09-18 12:22:44

How do volumes work in docker under windows 10 wsl?

The time that I worked with Docker, I worked only under Linux. Now I decided to try it under Windows, I installed WSL.
Under Linux, for example, I ran mysql as follows and everything worked, the database remained on the host.

docker run -d -e MYSQL_ROOT_PASSWORD=12345 -p 3306:3306 -v /home/developer/mysql-data:/var/lib/mysql mysql

The same command also works under Windows in WSL, but I want to save the database, say, on drive D in the mysql-data folder, I do this:
docker run -d -e MYSQL_ROOT_PASSWORD=12345 -p 3306:3306 -v /mnt/d/mysql-data:/var/lib/mysql mysql

And I get a bunch of messages and at the end:
2021-09-18T09:20:12.317091Z 0 [ERROR] [MY-010295] [Server] Could not set file permission for private_key.pem
2021-09-18T09:20:12.318444Z 0 [ERROR] [MY-010119] [Server] Aborting

Apparently there is no access, but the rights to mysql-data are such drwxrwxrwx
Is this a cant with WSL, namely with the /mnt/... paths?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question