I've run mysql in Docker (Docker for Windows 1.12.6, not docker toolbox) with command
docker run --name mysqldb -v /d/databases/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d -p 3306:3306 mysql:5.7
And when I've done it first time everything was great. How I've docker container with mysql and database directory on host machine mount as docker container volume.
But when I try to start container agan with command docker start mysqldb
I have error Error response from daemon: mkdir /d: file exists
Error: failed to start containers: mysqldb
What am I doing wrong? Is there any way to save my databases between container and docker restart?
UPD
This is out of docker ps -a
3b5b6cb91107 mysql:5.7 "docker-entrypoint.sh" 9 hours ago Up 15 seconds 0.0.0.0:3306->3306/tcp mysqldb
Container has been started but volume /var/lib/mysql
is no longer mount to host directory.
"Mounts": [
{
"Source": "/d/databases/mysql",
"Destination": "/var/lib/mysql",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],