4

I have a number of servers running as a swarm using docker swarm mode. There are several (5+) stacks running in the swarm each with their respective docker-compose.yml files.

I am mainly using docker stack deploy to manage my stacks (editing my docker-compose.yml then running deploy so that the compose files remain a true reflection of the running configuration). The down-side of this is that any changes I make directly to a service are lost on the next deploy, and it prevents me from using tools like portainer to their full potential.

In an ideal world I would like to be able to export my entire running configuration to a collection of docker-compose.yml files allowing me to manage any divergence between the running config and my current config.

I can see that I could roll something of my own using some shell scripting, docker inspect -f and some go templates, but I would have to maintain this all myself.

Are there tools or libraries out there to support my use case?

abronan
  • 3,309
  • 4
  • 29
  • 38
bsimpson53
  • 485
  • 5
  • 9

1 Answers1

0

The docker-compose.yaml file is part of your application, and should be kept in source control, following the "Infrastructure as code" logic.

However, at DockerCon 19, "Server side stack" support for Swarm was just announced. So you'll have an working solution in a few weeks or months.

Frank Louwers
  • 613
  • 4
  • 10