Bionix1441
Bionix1441

Reputation: 2319

Create a docker image of a postgres database?

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

Answers (1)

y6nH
y6nH

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

Related Questions