Hi all ,
Currently working on a CI/CD piece for deploying an environment.
The idea would be we’ve a repo with 15-20 microservices that are updated regularly and when they are we want to deploy them to a specific EC2 instance
for the deployment aspect I’ve been given two docker-compose yml files and essentially two commands by developers to run the stop / start
docker-compose -f ${path}/${1}/docker-compose.yml up -d
and
docker-compose -f ${path}/${1}/docker-compose.yml down
Now everything will work fine on the first run , in that it’s a fresh EC2 instance and the containers will deploy no problems.
My issues is with the when the MS is updated then we would run into issues.
Pulling xxxx (url-to-repo/xxxx:1234567)…
ERROR: The image for the service you’re trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuingContinue with the new image? [yN]
Now I’ve tried to circumvent this using combinations of
docker-compose -f ${path}/${1}/docker-compose.yml up -d --force-recreate
docker-compose -f ${path}/${1}/docker-compose.yml up -d -V
But I’m still blocked by having to tell docker that for each MS I want to recreate it.
In an attempt to just purge everything I even tried running
docker container stop $(docker container ls -a -q) && docker system prune -a -f --volumes
but even after that I still get asked for the confirmation.
Is there anything simple I’m missing here , or what are my options for an automated deployment that cannot rely on user input
using docker-ce 18.06.1-ce