Export your Docker compose files and structure

This useful command exports all the docker-compose.yaml files from a folder to another while keeping the tree structure.

Export your Docker compose files and structure

This useful command exports all the docker-compose.yaml files from a folder to another while keeping the tree structure.

It is a quick way to grab a clean, portable copy of your stack before backing it up, moving servers, or just keeping your setup somewhere safe.

find ~/docker/ -name '*docker-compose*.yml' -exec cp --parents \{\} ~/docker-structure/ \;

Run it whenever you want a fresh snapshot, it never touches the original files so there is no risk to your running containers.

Looking for help?
If you are looking for some help or want a quick chat, please head over to the Discord Community!