tianon / docker-postgres-upgrade

a PoC for using "pg_upgrade" inside Docker -- learn from it, adapt it for your needs; don't expect it to work as-is!
https://hub.docker.com/r/tianon/postgres-upgrade/
MIT License
1.04k stars 114 forks source link

Cannot create directory: File exists. #81

Closed vitalca closed 11 months ago

vitalca commented 11 months ago

I've prepared the required directory structure. The target dir is empty.

What am I doing wrong?

image

The second option works well:

docker run --rm \
 -v /data/pgdata/pg15-dev:/var/lib/postgresql/15/data \
 -v /data/pgdata/pg16-dev:/var/lib/postgresql/16/data \
 tianon/postgres-upgrade:15-to-16 

But it doesn't support the --link argument because, from the container's point of view, they are two different file systems, and cross-dev links are impossible. I don't have enough space for an entire copy of PGDATA.

vitalca commented 11 months ago

My fault. Softlinks are not working inside the container.

I added another volume binding, and it worked. Thank you!

docker run --rm \
 -v /data/pgdata/upgrade:/var/lib/postgresql \
 -v /data/pgdata:/data/pgdata \
 tianon/postgres-upgrade:15-to-16 --link