As of June 15th 2023, the official Postgres Docker images were published to be based on Debian 12.0 (Bookworm) rather than Debian 11.0 (Bullseye).
See Issues · docker-library/postgres · GitHub
CircleCI Support team has noted some customers seeing the following issues when using the official postgres
Docker image then:
# error seen when using postgres:13
popen failure: Cannot allocate memory
initdb: error: The program "postgres" is needed by initdb but was not found in the
same directory as "/usr/lib/postgresql/13/bin/initdb".
The Docker community (maintainers of the Postgres official image) are aware of the reported issues.
For folks encountering this error, we recommend try switching to *-bullseye
images as a workaround:
- postgres:14
+ postgres:14-bullseye
If this still does not solve your issue, you can also try using alternative Postgres images.
For example, you can consider using CircleCI’s convenience image as well:
- postgres:14
+ cimg/postgres:14
Alternatively, you can also try Bitnami’s Postgres images:
- postgres:14
+ bitnami/postgresql:14
References: