Create Test environment from Prod with Docker

Hi,

I’m trying to replicate the xwiki and mysql-xwiki containers to another VM but it doesn’t work for testing purposes. The database data (mysql-xwiki) doesn’t persist on the image when I “docker commit”. I do the following:

On Prod VM:
sudo docker commit 7c7a4a700519 mysql-xwiki_itx
sudo docker save mysql-xwiki_itx > /vagrant/mysql-xwiki_itx.tar

On Test VM:
sudo docker load < /vagrant/mysql-xwiki_itx.tar
sudo docker run --net=xwiki-nw --name mysql-xwiki -v /my/own/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=xwiki -e MYSQL_USER=xwiki -e MYSQL_PASSWORD=xwiki -e MYSQL_DATABASE=xwiki -d mysql-xwiki_itx:latest --character-set-server=utf8 --collation-server=utf8_bin --explicit-defaults-for-timestamp=1

“xwiki” database doesn’t persist. Would you know why and how to make xwiki database persist on the commit? I’m new with Docker.

Thanks,
Lester

I’ve managed to create a test environment by zipping “/my/own” directory and unzipping on the new test environment. It works fine but it would be better if I can commit and load the entire container to another VM (without transferring “/my/own” directory). Anyone knows the Docker trick?