I have a docker-compose image running:
version: '2'
services:
db:
image: postgres:commit1
service:
image: service:commit1
ports:
- "3000:3000"
depends_on:
- db
The image has a tag of commit id of git. If anything changes in code, CI/CD pipeline runs and updates the image with latest commit id.
Now let's say I have images as:
postgres:commit2 and service:commit2.
What is the best procedure to update the images given the containers are running using commit1 in the compose file?
Do I need to update the images manually in compose and then:
docker-compose restart
And remove the other containers manually?
Is it the best way?