GPrathap GPrathap - 1 year ago 84
MySQL Question

MySQL databases are gone when the docker container is shutdown

I am new to docker world. I want to install some of the software packages into docker image. So I have taken Ubuntu:14.04 docker image and installed MySQL server there. Then did some works with it. Once I exit from docker image and commit it. But once I start docker container, databases which was created were gone. What would be the reason for this?

n2o n2o
Answer Source

If you start your mysql database with docker run ..., it creates each time a new and fresh container with it. You can find your old one in the list of containers with docker ps -a and you have to start your old container (docker start <container>) if you want the last state. Otherwise you have a fresh database derived from your image.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download