0

I am a beginner to Docker, and I would like to know how can I create a Docker image of my existing postgresql database?

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

sorry for the stupid question, do I need an image of my linux pc or of postgresql?
The Postgresql Docker image contains a stripped-down Linux system with a Postgres server. You don't need to make any image yourself, just use the official one. The page linked above has good instructions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.