- 1,069
- 444
A user of the german Synology forum posted a bash snippet, which some of you mind find useful:
It will automaticly create a {container_name}-compose.yml per docker container, preconfigured with all settings the container had:
Of course the red5d/docker-autocompose can be used for a standalone container as well:
Feel free to replace
What a nugget
It will automaticly create a {container_name}-compose.yml per docker container, preconfigured with all settings the container had:
Code:
while read -r container_name; do
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose ${container_name} > ${container_name}-compose.yml
done <<< "$(docker ps --format '{{.Names}}')"
Of course the red5d/docker-autocompose can be used for a standalone container as well:
Code:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose $(docker ps -q --filter name=plex) > docker-compose.yml
Feel free to replace
$(docker ps -q --filter name=plex)
with a container name or id of your own choice.What a nugget