Lars Nyström
Lars Nyström

Reputation: 6373

Will a restarted docker compose service create a new container if the image has changed?

If a docker compose service stops for some reason, and is restarted automatically due to having a restart_policy, will it also re-create the container if:

  1. The docker image has changed? (For example if I'm using node:latest and have done docker pull node:latest and downloaded a newer image.)

  2. The docker image name has changed? (For example if I'm using an env var in the image name in docker-compose.yml, and the env var has changed.)

Or will it always just try to restart the existing docker container?

Upvotes: -3

Views: 34

Answers (1)

KamilCuk
KamilCuk

Reputation: 140782

It will always just restart the existing docker container.

Upvotes: 1

Related Questions