Closed forkedjensh closed 4 years ago
I'm not sure if the changes in MR #42 are the best solution but it allows the container to be created.
I have pushed a change to master to that should fix this issue. Could you test and confirm?
There's quite a bit to go. The creation of /data/dababase
and running chown
has to happen before initdb
, so moving it to before initdb
in the if clause would do the trick.
Current output:
➜ docker run --rm securecompliance/gvm
8:C 14 Jun 2020 12:48:10.092 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
8:C 14 Jun 2020 12:48:10.092 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=8, just started
8:C 14 Jun 2020 12:48:10.092 # Configuration loaded
Wait for redis socket to be created...
Testing redis status...
Redis ready.
Creating Data folder...
Creating Database folder...
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "C.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
creating directory /data/database ... initdb: error: could not create directory "/data/database": Permission denied
Sorry about that I didn't have time to test the change. I should have waited to push it. I pushed a new change and I am testing it now.
Starting postgresql works now. Thanks!
Is this actually fixed? (Or maybe my issue is different and I should start a new ticket?) I updated my container to the latest image, with an existing database and it's not starting due to missing config files as above.
gvm | Starting PostgreSQL... gvm | pg_ctl: another server might be running; trying to start server anyway gvm | waiting for server to start....postgres: could not access the server configuration file "/data/database/postgresql.conf": No such file or directory gvm | stopped waiting gvm | pg_ctl: could not start server
REPOSITORY TAG IMAGE ID CREATED SIZE securecompliance/gvm latest d758bbbd0477 9 hours ago 2.41GB
Does it only initialize the postgresql directory if there isn't an existing database? Surely I don't need to blow away my existing configuration on upgrade?
@sjwk could you open a new ticket?
Describe the bug Containers based on this image won't start because
pg_ctl
is missing its config filespostgresql.conf
,pg_ident.conf
andpg_hba.conf
.To Reproduce Steps to reproduce the behavior:
docker run --rm securecompliance/gvm:11.0.1-r1
(for simplicity I didn't set any environment variables and assigned no volume)Expected behavior A running container is created.
Screenshots ./.
Additional context It seems that
pg_ctl
is missingpostgresql.conf
,pg_ident.conf
andpg_hba.conf
. I am no expert on postgresql but using these files from/etc/postgresql/12/main/
creates a running container.[EDIT] Specify version/tag