Upgrading Nextcloud in a docker container?

According to the documentation, upgrading using docker-compose requires two commands:

docker-compose pull
docker-compose up -d

I have done this, and used occ to get out of maintenance mode. The trouble is that when I try to log into the web interface, I’m told that I can’t upgrade across more than one version (13 to 16 in my case). So - how do I use docker to upgrade one version at a time? Or alternatively, how can I upgrade so that Nextcloud isn’t confused by previous versions; that is, so that it is like a first-time installation? Thanks!

you will need to create docker-compose files for each version you need to hit.

depending on where the compose file came from, you might eb able to simply checkout each release from github, do the upgrade, rinse, and repeat until you’re on the version you need.

keep in mind, some versions need you to open the command prompt in the main contaner and run

occ upgrade