From: Matthias Apitz <guru@unixarea.de>
To: Bernd Graf <gbernd@gmx.de>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Filled Postgres server as Docker image
Date: Fri, 5 Jan 2024 12:15:49 +0100
Message-ID: <ZZfk5Yx5d72YghnN@pureos> (raw)
In-Reply-To: <b0a061b5-f133-41ff-822f-cd06c82b5963@gmx.de>
References: <b0a061b5-f133-41ff-822f-cd06c82b5963@gmx.de>
El día viernes, enero 05, 2024 a las 11:31:34 +0100, Bernd Graf escribió:
> Hi,
>
> for development and testing (integration testing) I want to have a
> Docker image with a pre-filled Postgres database. It should be a simple
> and quick task to spin-up this database, e.g., in a docker compose setup.
>
> Suggested solutions to achieve this goal are
>
> (1) To place initialization scripts at /docker-entrypoint-initdb.d and
> do the filling of the DB when the container is started the first time ->
> I want to avoid this, as it takes 20 minutes
>
> ...
Interesting, I'm working on a similar project. Having a podman image,
with:
- SuSE SLES 15
- PostgreSQL 15.x server with loaded database
- starting a bunch of application server on top of the PostgreSQL
server and offering there service on network sockets;
- and (ofc) having SSH into the image for debugging/testing;
I plan to have a similar PostgreSQL server outside the image, with
loaded database. Shut this down and create a tar archive of the full
server which then will be COPY'ed into the image at build time
and scripts in /entrypoint.d will arange everything.
matthias
--
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
I am not at war with Russia. Я не воюю с Россией.
Ich bin nicht im Krieg mit Russland.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: guru@unixarea.de, gbernd@gmx.de
Subject: Re: Filled Postgres server as Docker image
In-Reply-To: <ZZfk5Yx5d72YghnN@pureos>
References: <b0a061b5-f133-41ff-822f-cd06c82b5963@gmx.de> <ZZfk5Yx5d72YghnN@pureos>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox