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 1rLhUQ-009b5R-4E for pgsql-general@arkaria.postgresql.org; Fri, 05 Jan 2024 10:31:46 +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 1rLhUM-002FU3-A1 for pgsql-general@arkaria.postgresql.org; Fri, 05 Jan 2024 10:31:42 +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 1rLhUL-002FTv-S9 for pgsql-general@lists.postgresql.org; Fri, 05 Jan 2024 10:31:41 +0000 Received: from mout.gmx.net ([212.227.17.21]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rLhUI-00DrrD-I8 for pgsql-general@lists.postgresql.org; Fri, 05 Jan 2024 10:31:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1704450696; x=1705055496; i=gbernd@gmx.de; bh=+16IDd1Da//Osb7WkPzrYaJN7oAxkEDaeMeEnAYaKuI=; h=X-UI-Sender-Class:Date:From:Subject:To; b=fwAlCYiGMMsNiVx2YoK0/jPHNDI9HzTc0Ij0nigJ91Cb/V+Bdm3Eomo7zE2mWUu5 CUXIwfNKjWrlQOWPquV157hVGTp8QVgyR5ZiyMQxYqU1zIoIyLkrFzGCJf1DVHfSa CY5bkGZ0LUleHhytfiuUgz1N45BU7N8fSx8aHtrqHBx4EhmX3d/E5fGvQI2puFJqH kZk0cvqTFXniLMXp1rVw+T4biHyJC1jmNAOIBkVU2KeoPQm5k3kK5ypdsEJB9j5Ce FA/llqIvIR98q6Vgx1u1ejauotP7wdB+oEth8xp+KkXxtYnlB+59OSKdul937hZo6 MSIX5jKFITSvDIzbHQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [172.29.0.4] ([62.96.15.226]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MMGRK-1rbaDG009O-00JN41 for ; Fri, 05 Jan 2024 11:31:36 +0100 Message-ID: Date: Fri, 5 Jan 2024 11:31:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Bernd Graf Subject: Filled Postgres server as Docker image To: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:gzTvO5X9EuBc30zOBu7gQ1benEkuEZnfYON+eo6IVxiJRkhEtd1 v4zLj+M1sQj7Udn2DmCKDXnl+nppvgAnribAKMtrd2GdjOylwaWhx3R3MGm2j6nxhDeqcGy pt3M5bjZtbKgD0WuuN+Esj3diMKV9+0BsWBkiR7D4tz7nx7JuXTHoDmkJySm4ceVgpOCh8W RVGYS/CvRJNyoAeNoz+sA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:8jSqgoiiCV0=;l0SHObquNumX7ezu8UJxJ0h9Eyd 4FdqlW+alPlH79Wvw13yu9nzHPWy/lbUikEhPSfZG+09CGAtD84hhQWZp+IjvDtoR/tnqeFs+ zv8JqfdwaldXmAEaW44N4fUsR91WwfWpn2oVcLM5OdYT15E/pKU6+fyFUMRmVZxyh4SkO9ren IbJWS/Eyq2VZzDshJaJuVKDCGaUK8Boj3ohXEHhud1XBsqmWszZAjdsn4DJm8bUG8px00jV1c NhtlfgUZ/JneqWU2kXFd3Oylol6IQfLcdZU6z0MAPbP2uyVM0j7Cq6cWoLAR/ri6SDzoZm8S2 hJ93Yf+X9dUy5zWwGc3ixcMBv4vG7WyQzBZVVpuhUSllgh27GhjRQUyEVjWdwKAZ421U800ln KSjANpcuIC2PUhJE7Ab6CeHbGJ+4JDwbLXbbRl97aOf06dhaekDMusbK6iauXYlP7y1nX2uEE aNoJlRngemGDjmHOiVcLN9+OujjbuWtFmK7hRN8vDl3CmpC1MCJTPaK8NPqCTMw4DKrzfZFvq yiHDZMmVjoJgR/VSY3teRx4KQqvU1+0/gGVWfrF6BaWnfd7YeMyfsu5GAAlc34G/PHMAlvwzd Pe52d1N0nc19WAc/LimkHba84K2aVfjNuitIxAvh+5zeEASe+IkDDt7c/xKcHkUzuoTldFYC2 IDQZCILJ0uSa79WUgW5Twr0tLkn4OJrvodsH+HNHoWdy/uzuspVVbO3cUXepB66oSzfpDl9PI PSe2tP2I+oBW9JLJ19wDOaxzMtR86Tj61v4NcI6y8TEovYspXRwcv9upDuUY74Sj040FuQK3d FVmSRMzdz9HqbpBUQ71vbvL2UWexbefpVi5vmWhFjdTj9NJtTw1kpalhlCBApUH9an/ZCN+wH ixNDoZ+KEefHg+C54pj+Nek4rAFJV5gyET8LgFwqqKhQNusBG4WnJUQwabe6/hxha/5esUVaj MKuSIw== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 (2) To mount a volume to /var/lib/postgresql and have the data there -> I want to avoid this, as it requires to move and maintain the data folder separately Not suggested (at least this is what I found at mailing lists and at StackOverflow) is to burn the data into the container image. However, the reasons that are mentioned in these discussions "data is gone when the container is gone ..." is not my concern. As it is not easy to write a Docker build to achieve my goal, I would like to ask if there are reference projects / Docker build processes that perform this workflow? Reason why I consider it as not too easy: I have to manually start the Postgres server ignoring the intended entry-point script and then fill it with my data. Looking forward to your comments/suggestions! Bernd