Updating Portainer Stack Images - Best Practice

Currently reading
Updating Portainer Stack Images - Best Practice

Telos

Subscriber
2,455
794
NAS
DS418play, DS213j, DS3622+, DSM 7.2.4-11091
I'm curious what approach y'all find best for updating images used by stack deployments.

A brutish method is to delete the docker images, and then redeploy the stack.

Alternately, one can select each container manually, and then "Recreate" with the image pull option selected.

Any thoughts there? Other methods (using Portainer).

And a question for the obsessive/compulsive users here... When I launched a Bookstack stack, the containers appear with a simple Image label... for example, "lscr.io/linuxserver/bookstack:latest". However, if I stop the stack and make any change to the stack compose file (ex. change an external port) when I restart the stack, the individual container's Image name is more cryptic… for example... ".433ed418c483" ... Is that purposeful, or a "bug". If I then stop the stack, delete its images, and redeploy it, the Image name reverts to "lscr.io/linuxserver/bookstack:latest".

Thanks in advance 🎅
 
221
54
This is my method, maybe you can get useful information from it!

For the Portainer stacks I have a pull script that downloads new images once a month, I have this inserted as a scheduled task. Once the new images are downloaded I do an "update stack" via portainer and all containers are updated with the new images.
Then I remove all old images via portainer.

For my docker containers which are not created by portainer stack, but with docker-compose up command, I also have a script which looks like this:
Example for standardnotes containers:

Code:
docker pull standardnotes/syncing-server-js:1.42.9

docker pull standardnotes/api-gateway:1.27.0

docker pull standardnotes/auth:1.29.0

docker pull redis:latest

docker pull mariadb:latest

docker pull ericpierce/standardnotes-extension-server:latest

docker pull bytemark/webdav:latest

docker pull standardnotes/filesafe-relay:stable

Docker pull standardnotes/web:stable
sleep 10

cd /volume1/docker/standardnotes/server
docker-compose -p "standardnotes" up -d

I created a scheduled task for this as well and just need to manually click run and everything is updated.

For standardnotes, I have to do this manually because of the version tag which has to be updated first every time. But for containers that use the latest tag this could be set as a task automatically.

I don't know if my method is good but it works for mine.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Thanks. I saw that but wanted to confirm before I messed anything up!
Replies
4
Views
1,015

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Top