Today we are going to look at how to update a Docker container using Portainer.
There are many different ways to update Docker containers, but Portainer makes the process somewhat straightforward. To demo how to update a Docker container using Portainer, I will be updating an Nginx Proxy Manager container. Currently, I’m running an old version (2.3.1) and we will be updating that to the latest version.
Before starting this process, ensure that your container is created properly and volumes exist with your important data. If the data is not mapped to a local folder, it will be overwritten with the latest image data.
1. Select Containers, then stop the container that you’d like to update.
2. Select the container, and you’ll see a button named Recreate. By selecting this button, the container will take the persistent data and recreate the container. Keep in mind that the only data that will stay on the container is data that was mapped to a volume. This is explained in greater detail in the video above.
3. Select Pull latest image, then Recreate.
4. When this process is finished, the container will be recreated with the latest image. Select the container and Start it. The status will change to running.
5. The container will now exist with the newest released version!
2. Conclusion – Portainer Update Docker Container
As I stated above, this is not the only way of doing this. There are various ways, but this is what I consider to be the easiest. It’s good to periodically check and ensure that your containers are running the latest version. Keep in mind that you can always recreate an existing container using an older version if you run into any unexpected problems. This is what makes Docker containers so easy to work with!
Thanks for reading the tutorial. If you have any questions, feel free to leave them in the comments!