I'm trying to figure out the best way to back up the configuration of my Docker containers, especially since I'm running a lot of home automation on a mini PC. I've got the data part covered because I'm backing up the volumes, and I can always re-pull the images. However, I'm missing a straightforward way to back up the configuration details—like the port mappings and environment variables used when I run the containers.
Most of my setup is currently standalone and not using Docker Compose. I'm considering switching everything to Compose to make backups easier, but is there any other way to capture and later restore the configuration from standalone containers? I've seen suggestions about using `docker inspect ` and parsing the output with `jq`, but that feels overly complicated. Any advice?
1 Answer
You should definitely consider using Docker Compose. It's much simpler to manage and back up using `.yml` files. If you already have a lot of standalone containers, there's a tool called docker-autocompose that can help you convert your existing setups to Compose files. Just check it out on GitHub! It can really save you from a lot of manual work.

I completely agree! Once I started using Compose, tools like Auto-Compose really helped me get everything organized. Plus, with that script I created, it's super easy to generate the Compose files from existing containers.