Skip to content

Data is lost when a postgres container is commit has a new image. #445

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
cbadillac opened this issue May 18, 2018 · 2 comments
Closed

Data is lost when a postgres container is commit has a new image. #445

cbadillac opened this issue May 18, 2018 · 2 comments

Comments

@cbadillac
Copy link

cbadillac commented May 18, 2018

When I commit a container as a new image, and then I run this new image, all data that I saved in the original container are lost/erased.

How can I commit a container without to loss all data?

@cbadillac cbadillac changed the title Data is lost when a postgres container is commited has a new image. Data is lost when a postgres container is commithas a new image. May 18, 2018
@cbadillac cbadillac changed the title Data is lost when a postgres container is commithas a new image. Data is lost when a postgres container is commit has a new image. May 18, 2018
@wglambert
Copy link

Are you not mounting volumes?

If so, then you're looking to mount a volume for this https://github.com/docker-library/docs/tree/master/postgres#pgdata

Containers have a read/write layer that is temporary, when the container is 'stopped' it will retain data in that layer, when it's removed and started back up; you're doing so from the image which hasn't been modified. So you'd want volumes mounted from the host onto the container.

Given that the issue is more of a usability question, it would be more suited for the Docker Community Forums, the Docker Community Slack, or Stack Overflow.

@yosifkit
Copy link
Member

Duplicate of #375,

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