Skip to content

Document how to create container with existing schema #375

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
dsvensson opened this issue Nov 22, 2017 · 2 comments
Closed

Document how to create container with existing schema #375

dsvensson opened this issue Nov 22, 2017 · 2 comments

Comments

@dsvensson
Copy link

dsvensson commented Nov 22, 2017

In some cases the schema creation can take well over a minute. This makes it infeasible to use in continuous integration setups. It would be great if there was a well established, documented, way to create a container based on the output of a /docker-entrypoint-initdb.d-initialized container.

@laroque
Copy link

laroque commented Dec 30, 2017

Has there been any other response to this? I see a stack overflow post where you raise this issue (https://stackoverflow.com/questions/34751814/build-postgres-docker-container-with-initial-schema) which has a response with a reason for why we may not want to build the schema into the image, but nothing saying how to do it if that reason is not compelling when weighed against the slow container start time.

@tianon
Copy link
Member

tianon commented Jan 9, 2018

If you absolutely must bake the database files themselves into your images, you'll want to set PGDATA so that it no longer points at the pre-configured VOLUME location, thus allowing for the data to persist within the image. The exact location you choose doesn't really matter, as long as it's not a VOLUME.

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

No branches or pull requests

3 participants