I created a new named container for Memgraph Platform with:
docker run -ti -p 3000:3000 -p 7687:7687 -p 7444:7444 --name graph-assignment-7 memgraph/memgraph-platform:latest
I control the container using docker stop graph-assignment-7
and docker start graph-assignment-7
. I do this to avoid data loss.
My question relates to how Docker handles image updates? I’m curious about what occurs to my running container when a new image tagged as latest is released for memgraph/memgraph-platform
. Will my container automatically transition to this latest version, or do I need to manually intervene by pulling/blocking the new image and recreating the container? I actually want to prevent Docker container from being updated to the new version of Memgraph Platform.
I can’t post images due to message that I get (You need at least 10 reputation to post images.) but I hope that this link will work -> https://phpout.com/wp-content/uploads/2023/10/VZqhK.png
2
Answers
If you would run ‘start’ for already created docker container, it doesn’t do the transition to the latest version.
But when you will run ‘run’, it does the transition to the latest version.
Docker doesn’t update your running containers automaticially. It also doesn’t pull new versions of an image automatically.
To update a container, you need to kill it, pull the new image and run the image. I.e.
If you don’t do the
docker pull
, docker will run the image that is known aslatest
on your machine. That might not be the one that islatest
on Docker Hub.You can get
docker run
to check for a newer version and pull it by adding the--pull=always
option ondocker run
. The default is--pull=missing
which only pulls the image if it is missing on your local machine. More info here: https://docs.docker.com/engine/reference/commandline/run/#pull