Docker Community Forums

Share and learn in the Docker community.

Need help with Host Volume accidentally deleted


(Adalidda) #1


I run my mongo container with the following command
docker run -v $(pwd)/data:/data/db -p 27017:27017 mongo

Unfortunately, I delete by mistake the host volume while the container is running.
I notice that my app continue to run normally with the Mongo Database but when I go inside the docker container with command docker exec, I see that there are 0 files in /data/db

Are there a way to force my container to write persistence data back to the host or to the /data/db inside the container ?

I notice that if I stop the container then the data is lost forever !

Please help.

Thank You in advance
Kosona Chriv