-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Simple way to import configuration #581
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
Comments
Anything local should be avoided, in cluster it's especially important. Instead of mounting something under
|
I like the idea to have simple way to import configuration, especially And I still cannot understand why |
@vkukk It may not always be possible to use |
Unfortunately, we're not going to add additional behavior to the image as-is to enable this use case. However, as noted/demonstrated in #835 (comment), it isn't too hard to accomplish with what we do provide. 👍 |
@tianon It would be nice to provide at least reason(s), why such simple and seems not harmful change to default
=================
It is actually doesn't work for any "include" type configuration. I suggest to add that information to save time on investigation for other people. |
This container is rather handy but I've found it more difficult than I expected to apply a non-default configuration. Specifically I needed to install SSL certificates and keys, apply some
postgresql.conf
entries and modifypg_hba.conf
.To do so I had to create a setup script in
/docker-entrypoint-initdb.d/
to overwritepg_hba.conf
, append topostgresql.conf
and copy the SSL certs in from a bind mounted volume. Originally I actually went further and made a derived container that copied these things in before I realised I could just bind mount.I suggest:
/docker-entrypoint-initdb.d/
is a good way to run scripts and load configuration;/docker-entrypoint-initdb.d/copy-files.d/
directory. When present, copy everything incopy-files.d
to the new datadir (recursively, preserving mode and changing ownership to container user). So you can add an include_dir etc./docker-entrypoint-initdb.d/append-files.d/
directory. When present, append everything inappend-files.d
to the new datadir with the same filename, creating it if it doesn't exist.include_dir 'postgresql.conf.d'
to the generatedpostgresql.conf
. Document that any config file snippet placed in/docker-entrypoint-initdb.d/copy-files.d/postgresql.conf.d/
will be copied to the datadir and loaded as part of PostgreSQL's configuration. Or alternately just special casepostgresql.conf.d
in thedocker-entrypoint-initdb.d
and auto-enableinclude_dir
if it's present./docker-entrypoint-initdb.d/
run as the postgres user.The text was updated successfully, but these errors were encountered: