Re: BUG #17436: Initializing and starting with Dockerfile fails

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: dkeate(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17436: Initializing and starting with Dockerfile fails
Date: 2022-03-13 02:53:46
Message-ID: 20220313025346.obdsdilb4eygjlft@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Mar 12, 2022 at 07:24:26PM -0700, David G. Johnston wrote:
>
> Though I am curious that initdb didn't fail during the build since it
> doesn't seem like either -D or PGDATA have been set and one of those is
> required. I suppose it ended up using an unexpected location that didn't
> match up with the -D option to pg_ctl.

If you look a few lines above the link I sent you can see the PGDATA env being
set to the same location. The problem is only that this location is a volume.

> It is indeed possible to do what you are trying - to bake in an active
> database into the docker image, and not rely on a separate mounted volume
> for the database. But that also isn't really how the existing image is
> setup to be used and so you will need to figure out the customizations
> needed to make it do what you want

Also using the container layer to write data will perform ridiculously bad. If
the goal is only to read the data that might be ok, but maybe not. I think the
OP should better ask on Docker specific lists for guidance.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2022-03-13 18:10:19 BUG #17437: time spent in JIT is also attributed to function scan
Previous Message David G. Johnston 2022-03-13 02:24:26 Re: BUG #17436: Initializing and starting with Dockerfile fails