Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
skhaz opened this issue Apr 8, 2022 · 2 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@skhaz
Copy link

skhaz commented Apr 8, 2022

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
@wglambert wglambert added the question Usability question, not directly related to an error with the image label Apr 8, 2022
@wglambert
Copy link

You must specify POSTGRES_PASSWORD to a non-empty value for the
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".

A change was introduced that requires POSTGRES_PASSWORD to be set #658

@skhaz
Copy link
Author

skhaz commented Apr 8, 2022

Thank you

@yosifkit yosifkit closed this as completed Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

3 participants