Skip to content

Add POSTGRES_INITDB_ARGS env var #132

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 2 commits into from
Mar 15, 2016
Merged

Conversation

knickers
Copy link
Contributor

@knickers knickers commented Mar 4, 2016

This closes #19 per @tianon's suggestion.

$ docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_INITDB_ARGS="--data-checksums" --rm postgres
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are enabled.
...

@@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then

# look specifically for PG_VERSION, as it is expected in the DB dir
if [ ! -s "$PGDATA/PG_VERSION" ]; then
gosu postgres initdb
gosu postgres initdb "$POSTGRES_INITDB_ARGS"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will cause trouble if we need multiple arguments (ie, something like POSTGRES_INITDB_ARGS='--a --b --c --d="e f").

Something like this is probably what we'll have to do instead: (so we get quote parsing, etc as appropriate)

eval "gosu postgres initdb $POSTGRES_INITDB_ARGS"

@knickers
Copy link
Contributor Author

This also successfully enables data page checksums, but I have not tested it simultaneously with any other arguments.

@yosifkit
Copy link
Member

LGTM

@tianon
Copy link
Member

tianon commented Mar 15, 2016

LGTM 👍

tianon added a commit that referenced this pull request Mar 15, 2016
Add POSTGRES_INITDB_ARGS env var
@tianon tianon merged commit 057673e into docker-library:master Mar 15, 2016
yosifkit added a commit to infosiftr/stackbrew that referenced this pull request Mar 16, 2016
- `haproxy` Update to 1.6.4, 1.5.16, and 1.4.27
- `percona` Update to 5.7.11-4-1.jessie
- `postgres` docker-library/postgres#132
- `redmine` Update to 3.2.1, 3.1.4, and 2.6.10
- `ruby` Update rubygems to 2.6.2
RichardScothern pushed a commit to RichardScothern/official-images that referenced this pull request Jun 14, 2016
- `haproxy` Update to 1.6.4, 1.5.16, and 1.4.27
- `percona` Update to 5.7.11-4-1.jessie
- `postgres` docker-library/postgres#132
- `redmine` Update to 3.2.1, 3.1.4, and 2.6.10
- `ruby` Update rubygems to 2.6.2
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.

data page checksums
3 participants