How to update a Docker image with a new version of an image?

I am currently launching the official ghost Docker image and use this image to create multiple containers.

If I want to upgrade a Docker image, I just use the command:

docker pull ghost docker restart oldcontainer 

Does he work?

+5
source share
2 answers

No. Updating an image will not affect images created from this image, and , of course, does not affect already running containers created from this image.

One possible workflow would be sth. eg:

  • Pull the new version of the base image
  • Create a new version of your own image on top of the image
  • Destroy and recreate your own containers from a newly created image.
+4
source

A docker restart makes a docker stop (or docker kill if stop time) that puts the container in exit state, and then docker start , which starts the same container.

The fact that the image can be resized is not detected at all in this process.

Removing and performing a full launch of the docker with all the correct parameters will be associated with a change in the image. See " How to update the docker container after changing its image "

+3
source

All Articles