Does this work even when the Postgres is updated to a newer version? This would make me want to use docker as well.
My intuition is that you're expected to do some kind of migration or export/import, because the on-disk format probably changes between major versions.