From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: dkeate@gmail.com
Subject: BUG #17436: Initializing and starting with Dockerfile fails
Date: Sat, 12 Mar 2022 23:40:28 +0000
Message-ID: <17436-b8a4a3dd58c54838@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17436
Logged by: Dustin Keate
Email address: dkeate@gmail.com
PostgreSQL version: 14.2
Operating system: Docker/Raspberry Pi OS 64 bit
Description:
Dockerfile contents:
FROM postgres
USER postgres
RUN initdb
RUN pg_ctl -D /var/lib/postgresql/data -l /var/lib/postgresql/data/logfile
start
RUN pg_restore --dbname=dvdrental --create --verbose /var/dvdrental.tar
executing 'docker build .' throws the following error:
Step 4/5 : RUN pg_ctl -D /var/lib/postgresql/data -l
/var/lib/postgresql/data/logfile start
---> Running in 8561ab2addbe
pg_ctl: directory "/var/lib/postgresql/data" is not a database cluster
directory
However, starting a new container and running identical commands works.
docker run -it postgres sh
gosu postgres sh
initdb
pg_ctl -D /var/lib/postgresql/data -l /var/lib/postgresql/data/logfile
start
waiting for server to start.... done
server started
To me, these are identical processes, but I may be wrong because docker is
docker.
There are no volumes attached. These are the only instructions and I
couldn't distill this problem any farther. These are the only commands I am
giving. Something is changing in the intermediate images, somehow.
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, dkeate@gmail.com
Subject: Re: BUG #17436: Initializing and starting with Dockerfile fails
In-Reply-To: <17436-b8a4a3dd58c54838@postgresql.org>
* 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