Skip to content

Add newline to POSTGRES_PASSWORD file for initdb #1026

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

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

stanhu
Copy link
Contributor

@stanhu stanhu commented Dec 22, 2022

#1024 converted all echo calls to printf, but this change causes the password file used by initdb to be blank rather than contain a single newline. As a result, initdb will fail to start with an empty value with the error:

initdb: error: password file "/dev/fd/63" is empty

POSTGRES_PASSWORD can be blank if POSTGRES_HOST_AUTH_METHOD=trust is used. This change adds a newline to restore the original behavior.

Closes #1025

docker-library#1024 converted all
`echo` calls to `printf`, but this change causes the password file
used by `initdb` to be blank rather than contain a single newline.
As a result, `initdb` will fail to start with an empty value with
the error:

```
initdb: error: password file "/dev/fd/63" is empty
```

`POSTGRES_PASSWORD` can be blank if `POSTGRES_HOST_AUTH_METHOD=trust`
is used. This change adds a newline to restore the original behavior.

Closes docker-library#1025
@stanhu stanhu force-pushed the sh-add-newlines-to-initdb branch from 1ffe3ab to 41bd7bf Compare December 22, 2022 21:40
@tianon tianon merged commit ff5f92b into docker-library:master Dec 22, 2022
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Dec 22, 2022
Changes:

- docker-library/postgres@ff5f92b: Merge pull request docker-library/postgres#1026 from stanhu/sh-add-newlines-to-initdb
- docker-library/postgres@41bd7bf: Add newline to `POSTGRES_PASSWORD` file for initdb
@tianon
Copy link
Member

tianon commented Dec 22, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Container doesn't start with empty POSTGRES_PASSWORD: initdb: error: password file "/dev/fd/63" is empty
2 participants