Files Stuck in Docker!

Posted on Aug. 22, 2020 by Ted Martin

So I messed up a volume when creating a container and had a bunch of data in the container by the time I realized it. I DID NOT WANT TO LOSE THE DATA, so I was in a pinch. You have to correctly setup volumes and mounting before creating the container.

Life saving function of the day:

docker cp :/file/path/within/container /host/path/target

This allows you to copy data inside your container to your host machine. In my case it was a database.


Share post


There are no comments yet.

Add a new comment