I am trying to upgrade away from my deprecated Docker convenience images.
This build works:
version: 2.1
jobs:
build:
docker:
- image: circleci/openjdk:11
environment:
SPRING_DATASOURCE_USERNAME: springuser
REPO_NAME: danielahedges/circleci
- image: circleci/postgres:10.11-alpine-ram
environment:
POSTGRES_USER: postgresuser
POSTGRES_DB: db
steps:
- run:
name: Install psql
command: |
echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' | sudo tee --append /etc/apt/sources.list.d/pgdg.list
sudo wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y postgresql-client-10
- setup_remote_docker
- checkout
- run:
name: Query DB
command: psql -d db -U postgresuser -h localhost -c "select count(1) from information_schema.schemata;"
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!