-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Update postgres #20136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Update postgres #20136
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changes: - docker-library/postgres@2398775: Merge pull request docker-library/postgres#1372 from infosiftr/more-graceful-error - docker-library/postgres@5ec8931: Remove intentionally-breaking "data" symlink and add better detection
Diff for f2323ef:diff --git a/_bashbrew-cat b/_bashbrew-cat
index 04f04da..6fe0052 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -3,120 +3,120 @@ GitRepo: https://github.com/docker-library/postgres.git
Tags: 13.22, 13, 13.22-trixie, 13-trixie
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: a2433755c76d294477c85945d68944f8cdb7cf4b
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 13/trixie
Tags: 13.22-alpine3.21, 13-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 13/alpine3.21
Tags: 13.22-alpine3.22, 13-alpine3.22, 13.22-alpine, 13-alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 13/alpine3.22
Tags: 13.22-bookworm, 13-bookworm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: a2433755c76d294477c85945d68944f8cdb7cf4b
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 13/bookworm
Tags: 14.19, 14, 14.19-trixie, 14-trixie
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: a2433755c76d294477c85945d68944f8cdb7cf4b
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 14/trixie
Tags: 14.19-alpine3.21, 14-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 14/alpine3.21
Tags: 14.19-alpine3.22, 14-alpine3.22, 14.19-alpine, 14-alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 14/alpine3.22
Tags: 14.19-bookworm, 14-bookworm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: a2433755c76d294477c85945d68944f8cdb7cf4b
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 14/bookworm
Tags: 15.14, 15, 15.14-trixie, 15-trixie
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: a2433755c76d294477c85945d68944f8cdb7cf4b
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 15/trixie
Tags: 15.14-alpine3.21, 15-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 15/alpine3.21
Tags: 15.14-alpine3.22, 15-alpine3.22, 15.14-alpine, 15-alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 15/alpine3.22
Tags: 15.14-bookworm, 15-bookworm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: a2433755c76d294477c85945d68944f8cdb7cf4b
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 15/bookworm
Tags: 16.10, 16, 16.10-trixie, 16-trixie
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: a2433755c76d294477c85945d68944f8cdb7cf4b
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 16/trixie
Tags: 16.10-alpine3.21, 16-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 16/alpine3.21
Tags: 16.10-alpine3.22, 16-alpine3.22, 16.10-alpine, 16-alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 16/alpine3.22
Tags: 16.10-bookworm, 16-bookworm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: a2433755c76d294477c85945d68944f8cdb7cf4b
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 16/bookworm
Tags: 17.6, 17, 17.6-trixie, 17-trixie
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 87e6f65859a53d10c5170a587def1bfc882d3830
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 17/trixie
Tags: 17.6-alpine3.21, 17-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 17/alpine3.21
Tags: 17.6-alpine3.22, 17-alpine3.22, 17.6-alpine, 17-alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 17/alpine3.22
Tags: 17.6-bookworm, 17-bookworm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 87e6f65859a53d10c5170a587def1bfc882d3830
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 17/bookworm
Tags: 18.0, 18, latest, 18.0-trixie, 18-trixie, trixie
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 22ca5c8d8e4b37bece4d38dbce1a060583b5308a
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 18/trixie
Tags: 18.0-alpine3.21, 18-alpine3.21, alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 18/alpine3.21
Tags: 18.0-alpine3.22, 18-alpine3.22, alpine3.22, 18.0-alpine, 18-alpine, alpine
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 2c751341b6454412f2048de021a1f185212939de
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 18/alpine3.22
Tags: 18.0-bookworm, 18-bookworm, bookworm
Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 22ca5c8d8e4b37bece4d38dbce1a060583b5308a
+GitCommit: 5ec89312491bdaa2c42377a65ec0af2ecb774480
Directory: 18/bookworm
diff --git a/postgres_13-alpine/docker-entrypoint.sh b/postgres_13-alpine/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_13-alpine/docker-entrypoint.sh
+++ b/postgres_13-alpine/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_13-alpine3.21/docker-entrypoint.sh b/postgres_13-alpine3.21/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_13-alpine3.21/docker-entrypoint.sh
+++ b/postgres_13-alpine3.21/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_13-bookworm/docker-entrypoint.sh b/postgres_13-bookworm/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_13-bookworm/docker-entrypoint.sh
+++ b/postgres_13-bookworm/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_13-trixie/docker-entrypoint.sh b/postgres_13-trixie/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_13-trixie/docker-entrypoint.sh
+++ b/postgres_13-trixie/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_14-alpine/docker-entrypoint.sh b/postgres_14-alpine/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_14-alpine/docker-entrypoint.sh
+++ b/postgres_14-alpine/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_14-alpine3.21/docker-entrypoint.sh b/postgres_14-alpine3.21/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_14-alpine3.21/docker-entrypoint.sh
+++ b/postgres_14-alpine3.21/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_14-bookworm/docker-entrypoint.sh b/postgres_14-bookworm/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_14-bookworm/docker-entrypoint.sh
+++ b/postgres_14-bookworm/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_14-trixie/docker-entrypoint.sh b/postgres_14-trixie/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_14-trixie/docker-entrypoint.sh
+++ b/postgres_14-trixie/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_15-alpine/docker-entrypoint.sh b/postgres_15-alpine/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_15-alpine/docker-entrypoint.sh
+++ b/postgres_15-alpine/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_15-alpine3.21/docker-entrypoint.sh b/postgres_15-alpine3.21/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_15-alpine3.21/docker-entrypoint.sh
+++ b/postgres_15-alpine3.21/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_15-bookworm/docker-entrypoint.sh b/postgres_15-bookworm/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_15-bookworm/docker-entrypoint.sh
+++ b/postgres_15-bookworm/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_15-trixie/docker-entrypoint.sh b/postgres_15-trixie/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_15-trixie/docker-entrypoint.sh
+++ b/postgres_15-trixie/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_16-alpine/docker-entrypoint.sh b/postgres_16-alpine/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_16-alpine/docker-entrypoint.sh
+++ b/postgres_16-alpine/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_16-alpine3.21/docker-entrypoint.sh b/postgres_16-alpine3.21/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_16-alpine3.21/docker-entrypoint.sh
+++ b/postgres_16-alpine3.21/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_16-bookworm/docker-entrypoint.sh b/postgres_16-bookworm/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_16-bookworm/docker-entrypoint.sh
+++ b/postgres_16-bookworm/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_16-trixie/docker-entrypoint.sh b/postgres_16-trixie/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_16-trixie/docker-entrypoint.sh
+++ b/postgres_16-trixie/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_17-alpine/docker-entrypoint.sh b/postgres_17-alpine/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_17-alpine/docker-entrypoint.sh
+++ b/postgres_17-alpine/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_17-alpine3.21/docker-entrypoint.sh b/postgres_17-alpine3.21/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_17-alpine3.21/docker-entrypoint.sh
+++ b/postgres_17-alpine3.21/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_17-bookworm/docker-entrypoint.sh b/postgres_17-bookworm/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_17-bookworm/docker-entrypoint.sh
+++ b/postgres_17-bookworm/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_17-trixie/docker-entrypoint.sh b/postgres_17-trixie/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_17-trixie/docker-entrypoint.sh
+++ b/postgres_17-trixie/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_alpine/docker-entrypoint.sh b/postgres_alpine/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_alpine/docker-entrypoint.sh
+++ b/postgres_alpine/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_alpine3.21/docker-entrypoint.sh b/postgres_alpine3.21/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_alpine3.21/docker-entrypoint.sh
+++ b/postgres_alpine3.21/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_bookworm/Dockerfile b/postgres_bookworm/Dockerfile
index ba1bbe9..12fdb0c 100644
--- a/postgres_bookworm/Dockerfile
+++ b/postgres_bookworm/Dockerfile
@@ -189,7 +189,6 @@ RUN install --verbose --directory --owner postgres --group postgres --mode 3777
# NOTE: in 18+, PGDATA has changed to match the pg_ctlcluster standard directory structure, and the VOLUME has moved from /var/lib/postgresql/data to /var/lib/postgresql
#
ENV PGDATA /var/lib/postgresql/18/docker
-RUN ln -svT . /var/lib/postgresql/data # https://github.com/docker-library/postgres/pull/1259#issuecomment-2215477494
VOLUME /var/lib/postgresql
# ("/var/lib/postgresql" is already pre-created with suitably usable permissions above)
diff --git a/postgres_bookworm/docker-entrypoint.sh b/postgres_bookworm/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_bookworm/docker-entrypoint.sh
+++ b/postgres_bookworm/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}
diff --git a/postgres_trixie/Dockerfile b/postgres_trixie/Dockerfile
index 7c5ef69..6868de2 100644
--- a/postgres_trixie/Dockerfile
+++ b/postgres_trixie/Dockerfile
@@ -189,7 +189,6 @@ RUN install --verbose --directory --owner postgres --group postgres --mode 3777
# NOTE: in 18+, PGDATA has changed to match the pg_ctlcluster standard directory structure, and the VOLUME has moved from /var/lib/postgresql/data to /var/lib/postgresql
#
ENV PGDATA /var/lib/postgresql/18/docker
-RUN ln -svT . /var/lib/postgresql/data # https://github.com/docker-library/postgres/pull/1259#issuecomment-2215477494
VOLUME /var/lib/postgresql
# ("/var/lib/postgresql" is already pre-created with suitably usable permissions above)
diff --git a/postgres_trixie/docker-entrypoint.sh b/postgres_trixie/docker-entrypoint.sh
index 5a62870..785d0ff 100755
--- a/postgres_trixie/docker-entrypoint.sh
+++ b/postgres_trixie/docker-entrypoint.sh
@@ -168,8 +168,14 @@ docker_error_old_databases() {
Counter to that, there appears to be PostgreSQL data in:
${OLD_DATABASES[*]}
- This is usually the result of upgrading the Docker image without upgrading
- the underlying database using "pg_upgrade" (which requires both versions).
+ This is usually the result of upgrading the Docker image without
+ upgrading the underlying database using "pg_upgrade" (which requires both
+ versions).
+
+ The suggested container configuration for 18+ is to place a single mount
+ at /var/lib/postgresql which will then place PostgreSQL data in a
+ subdirectory, allowing usage of "pg_upgrade --link" without mount point
+ boundary issues.
See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
@@ -264,6 +270,9 @@ docker_setup_env() {
OLD_DATABASES+=( "$d" )
fi
done
+ if [ "${#OLD_DATABASES[@]}" -eq 0 ] && [ "$PG_MAJOR" -ge 18 ] && mountpoint -q /var/lib/postgresql/data; then
+ OLD_DATABASES+=( '/var/lib/postgresql/data (unused mount/volume)' )
+ fi
fi
}Relevant Maintainers: |
tianon
approved these changes
Oct 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes: