I have a docker stack deployed with 20+ services which comprise my application. I would like to know that is there a way to update this stack with the latest changes to the software from within one of the containers running as a part of the stack?
Approach i have tried:
- In one of the containers for a service, mounted the docker socket and the /usr/bin/docker file and downloaded the latest compose file from the server.
- Instantiated a script which downloads the latest images
- Initiate a
docker stack deploy
with the new compose file
Everything works fine this way but if the service which is running this process itself has an update and if that docker stack deploy
tries to create this service before any other service in the stack, then the stack update fails.
Any suggestion or alternative approaches for this?