You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
I think the difference is the use of BuildKit rather than legacy docker build. For some reason BuildKit includes /var/lib/postgresql/data in the image, so you need to set DOCKER_BUILDKIT=1 when building the image, and that should be mentioned in docker/README-testing.md. But you need to do that when building the other two images as well, so I'm surprised that you got this far without it.
A possibly-more-correct workaround would be to have the postgres_base image construct the database in a different directory.
babolivier
added
A-Docs
things relating to the documentation
T-Task
Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
labels
Jul 21, 2022
I tried to build the
complement-synapse
image, as described indocker/README-testing.md
, but when I randocker build -t complement-synapse -f docker/complement/Dockerfile docker/complement
, it failed, saying:It appears that it did not persist the changes to
/var/lib/postgresql/data
that were made in the previousDockerfile
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 aVOLUME
in thepostgres
image, which means that changes to that directory are discarded.If I combine the three
RUN
statements in thepostgres
section of theDockerfile
into a single line, then the build "succeeds", but of course the/var/lib/postgresql/data
directory is still empty in the resulting image.The text was updated successfully, but these errors were encountered: