Reputation: 2319
I am a beginner to Docker, and I would like to know how can I create a Docker image of my existing postgresql database?
Upvotes: 0
Views: 407
Reputation: 563
Your best bet is to pull the standard, preconfigured Postgres image (of the appropriate version) from Docker Hub. Set it up with a volume for storing the database. Use pg_dump
to export your existing database, and pg_restore
to the new one.
Upvotes: 3