-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Unable to build complement-synapse
Docker image #13319
Description
I tried to build the complement-synapse
image, as described in docker/README-testing.md
, but when I ran docker build -t complement-synapse -f docker/complement/Dockerfile docker/complement
, it failed, saying:
...
Step 4/21 : RUN echo "ALTER USER postgres PASSWORD 'somesecret'" | gosu postgres postgres --single
---> Running in cbf9ce044882
postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory
The command '/bin/sh -c echo "ALTER USER postgres PASSWORD 'somesecret'" | gosu postgres postgres --single' returned a non-zero code: 1
It appears that it did not persist the changes to /var/lib/postgresql/data
that were made in the previous Dockerfile
step did not get persisted, and so /var/lib/postgresql/data
remains empty. This seems to be because /var/lib/postgresql/data
is marked as a VOLUME
in the postgres
image, which means that changes to that directory are discarded.
If I combine the three RUN
statements in the postgres
section of the Dockerfile
into a single line, then the build "succeeds", but of course the /var/lib/postgresql/data
directory is still empty in the resulting image.