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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: 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:24:26
Message-ID: CAKFQuwa=O1hN5eeJmKUbKpa2nhQXQTn-w3BdzD67-YB4MQJcdg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Mar 12, 2022 at 6:02 PM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:

> However, starting a new container and running identical commands works.
>

You will need to explain how the equivalent of postgres.sh is being run in
the build variant.

> docker run -it postgres sh
>
> To me, these are identical processes, but I may be wrong because docker is
> docker.
>
>
I don't think docker is really the issue here.

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. I'll admit I don't know the exact
environment changes being done in the build environment via USER and the
runtime environment via gosu. But in any case the claim that the two
setups are identical is simply wrong.

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 - the documentation and scripts will
probably get you close but probably not exactly at your destination.

And as noted, this is not a bug, and even if it was, the core project would
not be the team responsible for addressing it. In addition to posting to
the docker specific resources if you do want to reach the broader community
for help the -general list is what you would want to use.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Julien Rouhaud 2022-03-13 02:53:46 Re: BUG #17436: Initializing and starting with Dockerfile fails
Previous Message Julien Rouhaud 2022-03-13 02:04:38 Re: BUG #17436: Initializing and starting with Dockerfile fails