Search code examples
linuxdockermesosmarathon

Restore deleted container docker


I have a docker container that was running postgresql db but it was accidentally deleted by my Apache Mesos Marathon.

Is there any way I can restore the container or at least, get the database files?

Thanks


Solution

  • If it's just stopped, rather than removed, you should be able to find it under docker ps -a and just run docker start CONTAINER.

    Unless the database was removed with docker rm -v CONTAINER, the database files are probably still in a directory somewhere under /var/lib/docker/vfs/dir/, but you may have a hard time figuring out which one. If you do manage to figure out the correct directory, you should be able to restore the db by just mounting the directory into a new database instance.