Closed fulwang closed 2 years ago
Instead of restarting the container, stop the container, and start a new container on the same vol_mysql01
volume. Env variables and /dcoker-entrypoint-initdb.d
volume are no longer required.
Many Thanks @grooverdan !
Want to read & execute a initialization sql file mounted in docker-entrypoint-initdb.d directory and persist Mariadb data to named volume, and it succeeded. But then how to remove the mapped volume mounted on docker-entrypoint-initdb.d directory after that? now, when i restart the container, i can see the mapped volume still mounted through the docker inspect command.
docker run -d --name perfdb02 -e MARIADB_DATABASE='pkt' -e MARIADB_USER='puser' -e MARIADB_PASSWORD='test' -e MARIADB_ROOT_PASSWORD='654321' -v /Users/fulwang/seed:/docker-entrypoint-initdb.d/ -v vol_mysql01:/var/lib/mysql mariadb:latest