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

Refactor listen_addresses to be set in the sample file, and make the sample file easier to overwrite #127

Merged
merged 2 commits into from
Mar 2, 2016

Conversation

tianon
Copy link
Member

@tianon tianon commented Feb 26, 2016

Closes #120
Fixes #105
Closes #54

(needs documentation updates too)

@tianon
Copy link
Member Author

tianon commented Feb 26, 2016

This also updates the entrypoint to allow for docker run postgres --flag --flag --flag.

@tianon
Copy link
Member Author

tianon commented Feb 26, 2016

This makes it possible for folks who want to embed a custom config in a new image (or to modify the existing config) to just replace /usr/share/postgresql/postgresql.conf.sample instead of thinking about which version of PostgreSQL they're using (or reference PG_MAJOR, which isn't even available at the time of -v when starting a container).

@yosifkit
Copy link
Member

yosifkit commented Mar 2, 2016

LGTM

yosifkit added a commit that referenced this pull request Mar 2, 2016
Refactor listen_addresses to be set in the sample file, and make the sample file easier to overwrite
@yosifkit yosifkit merged commit c82348f into docker-library:master Mar 2, 2016
@yosifkit yosifkit deleted the listen_addresses branch March 2, 2016 22:58
@omidraha
Copy link

@tianon

Now, can you give me an example on how to replace postgresql.conf and pg_hba.conf configuration files,

I do something like:

docker run \
  -v /somewhere/postgres/data:/var/lib/postgresql/data \
  -v /somewhere/postgres/postgresql.conf:/etc/postgres/postgresql.conf:ro \
  -v /somewhere/postgres/pg_hba.conf:/etc/postgres/pg_hba.conf:ro  postgres:9.4

But postgres ignores them.

@tianon
Copy link
Member Author

tianon commented Mar 16, 2016

@omidraha see #134 (comment):

We have not yet added docs on overriding the config, 😞

If you are replacing the .example with something like -v /my/local/postgres.conf:/usr/share/postgresql/postgresql.conf.sample then you would need to make sure that your conf file has a listen_addresses='*'. (where as a previously undocumented feature, you could've mounted to /usr/share/postgresql/9.5/postgresql.conf.sample and the startup script would've rewritten your listen address line for you.)

@thongly
Copy link

thongly commented Dec 28, 2016

Found this thread and the related thread that @bw-matthew started, but with much effort.

@tianon - I feel that this is a very common use case. Should we include this in the README or docs?

@FrankFang
Copy link

@omidraha How did you resolve it?

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.

None yet

6 participants