Not totally ideal if you're using containers as it requires the binaries of the old and new version, unless I'm missing something.
Also it looks like this is not new https://github.com/docker-library/postgres/issues/37
Notsomuch for production. I know... folks do it. But I wouldn't run anything on it that I wouldn't do w/ sqlite.
Also, in general, that persistent storage is (generally) not locally attached, which means that (some) file system interactions may have unexpected semantics. Now, with a DB, you're probably only going to have the PV attached on a single worker node, so most of that will actually just work.
Debian even has special custom helper scripts for doing it. So just build your container with both postgres versions?