I created a mysql container using the officially supported mysql image. I ran the image mounting a folder that contains a sql dump, then I created a new database in the cont
Based on the @dekin research, I did this to solve the issue:
Dockerfile:
FROM mysql:latest RUN cp -r /var/lib/mysql /var/lib/mysql-no-volume CMD ["--datadir", "/var/lib/mysql-no-volume"]
Build & run:
docker build . -t my-mysql docker run -e MYSQL_ROOT_PASSWORD=root -it my-mysql