The postgres:18 Docker image declares its volume at /var/lib/postgresql and keeps data in /var/lib/postgresql/18/docker, while postgres:17 used /var/lib/postgresql/data, so the old mount path is
In our tests the 18.6 container exited with status 1 on a Postgres 17 volume, an empty named volume and an empty bind mount, and pinning PGDATA to the old path failed on 17 data with 'database files
Upgrading a 762 MB database took 64 seconds by dump and restore and 6 seconds with pg_upgrade --link, which fails a data checksum check unless you pass --no-data-checksums.