Skip to content

Extending DB initialization in docker-entrypoint.sh #22

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

Closed
md5 opened this issue Oct 7, 2014 · 3 comments · Fixed by #23
Closed

Extending DB initialization in docker-entrypoint.sh #22

md5 opened this issue Oct 7, 2014 · 3 comments · Fixed by #23

Comments

@md5
Copy link
Contributor

md5 commented Oct 7, 2014

I'm working on creating a PostGIS container based on this one and ended up replacing the docker-entrypoint.sh with my own modified version in order to create a template_postgis database (cf. https://github.com/md5/docker-postgis/blob/master/docker-entrypoint.sh#L10-17).

I'd like to propose that docker-entrypoint.sh somehow be extended to allow derived images to do additional work when a new database is being initialized. I can provide a PR with a patch, assuming there's agreement that this is a desirable change. I'd probably default to using a /docker-entrypoint.d/ directory or something of that sort.

@md5
Copy link
Contributor Author

md5 commented Oct 7, 2014

It looks like this issue was also alluded to in #16.

@tianon
Copy link
Member

tianon commented Oct 8, 2014

I'm definitely +1 on something like /docker-entrypoint-initdb.d (specific to initdb, since that's the situation these would be run in), especially if it makes it easier to use the script as-is and not have to copy it over and sync any future updates yourself.

So in that case, maybe it should even run at the end of that if block, so that our postgresql.conf and pg_hba.conf could be reverted or changed by these scripts as well. What do you think?

@md5
Copy link
Contributor Author

md5 commented Oct 8, 2014

I'm fine with running it after the *.conf changes. I'll submit a PR for this soon and use the name docker-entrypoint-initdb.d. I'll also create a PR for docker-library/docs to document the feature.

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 a pull request may close this issue.

2 participants