However, if I just change the openjdk container from circleci/openjdk:11 to cimg/openjdk:11.0, the simple database query hangs, apparently unable to contact the database.
Is there a difference between the two containers that would explain how to connect to the database?
Thanks for your post. I did some research and I figured out how to get this example to work. With the next-gen OpenJDK image, set the environment variable pager to cat. Also, in this example, you are installing a package for PostgreSQL meant for Debian Stretch. The new image is Ubuntu 20.04 based. So I’d change stretch to focal. Here’s the updated example:
I will get this environment variable set in cimg/base. The change will take some time to trickle down to the rest of the images but new PostgreSQL images released starting in April will have the change. In the meantime, setting this in your config like I showed should do the trick.