Some time ago I wanted to update my self-hosted PostgreSQL containers (for stuff like Nextcloud, and Gitea) and did not find a good solution to running pg_upgrade in such an environment.
To that end I created a little container [0] that tries to upgrade the database from one version to another.
Maybe this is useful to some of you :)
[0] https://github.com/alexandrospanagiotidis/postgres-upgrader