How to restart the container automatically after the docker image is updated?

  docker, question

In continuous integration, if the code push builds a new image, then if there is a container running the old image, how to restart the container and start it based on the latest image? Can only stop the container-delete the container-delete the mirror-pull the latest mirror-start the container to execute like this?

Yes, there needs to be a service to do continuous integration work, such as Jenkins.