Welcome to the Linux Foundation Forum!

Postgres errors in 10. Continuous Delivery to Dev with Docker Compose

My app failed to work properly with the suggested postgres:9.4 image and docker-compose.yaml.

docker-compose logs db for the error:

  1. Error: Database is uninitialized and superuser password is not specified.
  2. db_1 | You must specify POSTGRES_PASSWORD for the superuser. Use
  3. db_1 | "-e POSTGRES_PASSWORD=password" to set it in "docker run".
  4. db_1 |
  5. db_1 | You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
  6. db_1 | without a password. This is *not* recommended. See PostgreSQL
  7. db_1 | documentation about "trust":
  8. db_1 | https://www.postgresql.org/docs/current/auth-trust.html

Add environment variable:

  1. db:
  2. image: postgres:9.4
  3. environment:
  4. POSTGRES_HOST_AUTH_METHOD: trust
  5. ...

:innocent: All better :innocent:

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • postgres image has been recently updated and now requires a environment variable. You could use either of the following.

    1. POSTGRES_HOST_AUTH_METHOD: trust
    2. POSTGRES_PASSWORD=password

    I would update the instructions/code accordingly.

  • Posts: 4

    You should also do docker-compose down to clean up, and then recreate with docker-compose up -d to make it work.

    Regards.-

  • Posts: 13
    edited December 2021

    Can you please update the course content, I spent more time that I would have liked trying to get this to work, when it was as simple as adding an entry to env.

    ** turns out the next video went over this

    I like to follow along, and when the video shows that the setup works I pause and try to get it working myself.

  • Hi @tomp736 , we are updating the course content in batches. So in the next update we'll make sure to include this one.

    Also, please know that the DevOps world is changing very fast in terms of the technical stuff. We have seen this in various things, so be aware of this.

    Many regards,
    Luis.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training