Access container data without volume

Some time ago, I created a container with Shlink from the default compose file in their docs. I didn’t do any changes to that compose file, and haven’t connected a volume. This wasn’t a problem for me at first, because I just used it for testing the software, no real data stored.

Now I’ve used it for some time, since it was running smoothly and created lots of short links (stored data). But since I want to move it to another instance, I need the data, which I don’t know where it is. I tried to connect to the container doesn’t work. I checked /var/lib/docker/volumes and /var/lib/docker/containers/CONTAINER to check if there is any data.

I already checked the Shlink docs to see if there is something but haven’t found anything useful. Can anyone tell me how I could get the data of that container?
I posted it here because I think it is a general docker question, because the same could be asked for other software.

Stop the container and you can use docker cp to copy files out of a stopped container. Where the saved files are, that should be documented in the documentation of the software or the Docker image, but docker diff can also tell you what changed in the contaiener compared to the original image filesystem, so you can try to recognize those you need to copy out.

1 Like

Thanks very much! I was able to find the database in /etc/shlink/data/database.sqlite with docker diff and copied it. Have a nice day!