In any case it's way more straightforward with mysql.
[1] https://hub.docker.com/r/tianon/postgres-upgrade
https://hub.docker.com/r/pgautoupgrade/pgautoupgrade
---
That being said, those pgautoupgrade images are alpine Linux based.
People coming from non-alpine Linux images of PostgreSQL will probably need that older not-automatic approach you linked to.
In any case it's way more straightforward with mysql.
[1] https://hub.docker.com/r/tianon/postgres-upgrade