Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rLiBC-009fEa-V4 for pgsql-general@arkaria.postgresql.org; Fri, 05 Jan 2024 11:15:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rLiBB-002mTK-M0 for pgsql-general@arkaria.postgresql.org; Fri, 05 Jan 2024 11:15:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rLiBB-002mTC-BL for pgsql-general@lists.postgresql.org; Fri, 05 Jan 2024 11:15:57 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rLiB8-00DsBh-8F for pgsql-general@lists.postgresql.org; Fri, 05 Jan 2024 11:15:56 +0000 Received: from [212.222.85.114] (helo=pureos) by ms-10.1blu.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rLiB4-0014gE-S6; Fri, 05 Jan 2024 12:15:50 +0100 Date: Fri, 5 Jan 2024 12:15:49 +0100 From: Matthias Apitz To: Bernd Graf Cc: pgsql-general@lists.postgresql.org Subject: Re: Filled Postgres server as Docker image Message-ID: Reply-To: Matthias Apitz References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: FreeBSD 14.0-CURRENT 1400094 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 212.222.85.114 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.