When you execute docker run, a new container is created and started based on a specified Docker image. By default, these containers are designed to be stateless.
So No persistent data. Any data written inside the container's filesystem will be lost when the container is stopped and removed.Each run is isolated. Every time you docker run an image, you get a fresh instance of image.
So that your data is losing.To keep this you must persist the data outside the container.For that you need to explicitly manage data using:-
Volumes: Docker volumes are the preferred mechanism for persisting data generated by and used by Docker containers. They are managed by Docker and exist independently of the container's lifecycle.
file or directory from the host machine into a container: This provides link to host data
For this you can either create a docker volume or explicit path
A named Docker volume is a mechanism for persisting data generated by containers.The data will kept inside the volume and persist
https://docs.docker.com/engine/storage/#tips-for-using-bind-mounts-or-volumes