Hi@akhtar,
You need to create a volume in Docker and mount the same volume to your docker container. Then only your database will not erase. You can use the below commands.
$ docker volume create grafana-storage
$ docker run -d -p 3000:3000 --name=grafana -v grafana-storage:/var/lib/grafana grafana/grafana