Skip to content

[Regression] Recent versions are not reading scripts in docker-entrypoint-initdb.d #950

Closed
@skhaz

Description

@skhaz

When I run with version 10 I am able to execute all scripts in my scripts folder

docker run -it --rm --name pgsql --mount type=tmpfs,destination=/var/lib/postgresql/data -v $(pwd)/scripts:/docker-entrypoint-initdb.d -p 5432:5432 postgres:10.1-alpine

2022-04-08 13:26:52.607 UTC [41] LOG:  database system is ready to accept connections
 done
server started
ALTER ROLE


/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/init-user-db.sh
CREATE ROLE
CREATE DATABASE
GRANT

2022-04-08 13:26:52.956 UTC [41] LOG:  received fast shutdown request

However, in the new versions, I get an error:

docker run -it --rm --name pgsql --mount type=tmpfs,destination=/var/lib/postgresql/data -v $(shell pwd)/scripts:/docker-entrypoint-initdb.d -p 5432:5432 postgres:14

Error: Database is uninitialized and superuser password is not specified.
       You must specify POSTGRES_PASSWORD to a non-empty value for the
       superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".

       You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
       connections without a password. This is *not* recommended.

       See PostgreSQL documentation about "trust":
       https://www.postgresql.org/docs/current/auth-trust.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions