To follow up on what @jibaku said, your specific issues is that the Postgres client software (
psql) is not installed by default in
circleci/python Docker images. That’s normal, since installing it by default would bloat the image size for something only a subset of the users need.
circleci/python are based on the official Docker images using the Debian Jessie base. This leaves you with two options if you need
psql installed. First, you can install
psql as part of your CircleCI set-up using a
- run: apt-get install -y postgresql-client
This can add some unnecessary time to your build, though. Instead, I would recommend you build a custom Docker image with exactly the tooling you need. You can even use the CircleCI image as a base:
RUN apt-get update && apt-get install -y postgresql-client
You can find more details about building custom images on the documentation page “Using Custom-Built Docker Images”.
An additional point: you do not need to use
sudo here. The Docker image has already set the user to
circleci. Even if it did not, executing under the
circleci UID would not provide much benefit for this command.