Update Ignition in a Docker Container

I’m using portainer to manage docker containers. I have a 8.1.5 container that has a persistent volume, and I want to upgrade it to 8.1.9.

Most guides say you can stop the container, recreate it. I’ve also tried recreating the container and manually specifying the 8.1.9 image, but the status page of the gateway still says 8.1.5.

any tips?

I’m looking at it again and noticed I have my volume bound to

/usr/local/bin/ignition
and not
/usr/local/bin/ignition/data

so I guess that makes sense that nothing is changing when I try to upgrade the containter :sweat_smile:

can i run the installer manually from a console session in the container?

Good catch–yes, you need to have your volume bound to the data/ folder only. Otherwise you’ll have too much of the base image contents (such as the various modules, libraries, etc) captured in your volume. Upgrading once you have your data volume in place is just a matter of stopping the container (and then removing it) and then launching a new container (attached to the same volume) from the updated image.

At this point, I’d just take a gateway backup of what you have right now (assuming there is substance there) and start with a fresh container (with the correct volume configuration).

thanks @Kevin.Collins

I had some stuff in my webserver folder that i was trying to preserve which is why I think i did it that way.

but yeah i started a new container, did the volume binding properly, and then added a 2nd volume for just the webserver/webapps/main folder , and then did a gateway backup restore and everything seems to be working fine.

Gotcha… You’re correct to identify a few edge cases related to preserving user-level content within the gateway. Most everything is stored in data/, but there are a few outliers. JDBC drivers, third-party modules, and custom pylib content come to mind. Generally, if you’re adding new sub-folders via additional volumes (versus inheriting existing content from the base image, such as is the case with data/) you’ll be fine.

That said, you can also build your own custom derived image where you package in some of this custom code (that isn’t part of a traditional Ignition project/tags/etc) into the image itself. It can be as simple as a FROM inductiveautomation/ignition:<tag> (to bring in everything else from the base image) and then a couple COPY statements to bring your files in. Then you’d launch your container against mcarritt1/ignition:8.1.9, for example. I should have some good examples for folks to draw inspiration from on the IA Github “soon”. :smiley:

2 Likes