
Introduction
With the first release of Foswiki since I started maintaining timlegge/docker-foswiki I wondered how painful the upgrade would be. I had vague visions of Migrating Foswiki 1.1.9 on Ubuntu to Foswiki 2.1.6 on Docker which was certainly an undertaking.No, it was much simpler than that but the nature of Docker images means its a little different.
Persistent Volumes
In order for a docker instance to host something like Foswiki it needs persistent volumes. That is a place to hold the changing content. In timelegge/docker-foswiki the provided docker compose files esentially put the entire Foswiki website on a persistent volume. The way Foswiki automatically inter-mingles some of the data and code (or more properly automatically generates content sections under data) makes it difficult to do anything else.
So, simply pulling the latest Docker image for timlegge/docker-foswiki means you get all the updated alpine linux packages but Foswiki remains at the same version.
Upgrading
The steps are pretty minor and are essentially the exact came that are documented at here.- Download the upgrade package
- Copy it to your Docker Image's persistent volume
- Unzip/tar over the existing Foswiki Installation
- Save the updated LocalSite.cfg
- Restart your Docker Container
Example Steps assuming your Docker Container can access the Internet
docker exec -it docker-foswiki /bin/bash cd /var/www/foswiki wget https://github.com/foswiki/distro/releases/download/FoswikiRelease02x01x07/Foswiki-upgrade-2.1.7.tgz tar --strip-components=1 -zxf Foswiki-upgrade-2.1.7.tgz cd tools ./configure --save rm Foswiki-upgrade-2.1.7.tgz exit
Then you simply need to restart your docker image to cache the updated Perl Code
Example Steps assuming your Docker Container cannot access the Internet
wget https://github.com/foswiki/distro/releases/download/FoswikiRelease02x01x07/Foswiki-upgrade-2.1.7.tgz cp Foswiki-upgrade-2.1.7.tgz /var/lib/docker/volumes/foswiki_foswiki_www/_data docker exec -it docker-foswiki /bin/bash cd /var/www/foswiki tar --strip-components=1 -zxf Foswiki-upgrade-2.1.7.tgz cd tools ./configure --save rm Foswiki-upgrade-2.1.7.tgz exit