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)

…sample file easier to overwrite
@tianon
Copy link
Member Author

@tianon 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 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 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
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@yosifkit yosifkit deleted the infosiftr:listen_addresses branch Mar 2, 2016
@bynare

This comment has been minimized.

Copy link

@bynare bynare commented on Dockerfile.template in 41e7a62 Mar 9, 2016

should the exclamation marks not be "/"'s??

This comment has been minimized.

Copy link
Member Author

@tianon tianon replied Mar 9, 2016

Either is fine: (from https://www.gnu.org/software/sed/manual/sed.html#The-_0022s_0022-Command)

The syntax of the s (as in substitute) command is ‘s/regexp/replacement/flags’. The / characters may be uniformly replaced by any other single character within any given s command. The / character (or whatever other character is used in its stead) can appear in the regexp or replacement only if it is preceded by a \ character.

@omidraha
Copy link

@omidraha omidraha commented Mar 16, 2016

@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 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 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

@FrankFang FrankFang commented Aug 12, 2017

@omidraha How did you resolve it?

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

Successfully merging this pull request may close these issues.

None yet

6 participants