Forum OpenACS Development: Looking for Postgres Data_Directory of postgres-10-alpine docker container

kmw@caltek$ sudo docker run -it postgres:10-alpine /bin/bash
bash-5.0# whoami
root
bash-5.0# su - postgres
b030bcb67163:~$ psql -c "show data_directory"
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
b030bcb67163:~$
volume name: openacs_db_data
located:
/var/lib/docker/volumes/openacs_db_data/_data
Keep in mind that this finding depends on how docker is handling the volumes on your system. You should normally not access your volume directly from the docker host.
Hi, I'm tried this,

kmw@caltek$ sudo docker run -it postgres:10-alpine /bin/bash
bash-5.0# whoami
root
bash-5.0# su - postgres
b030bcb67163:~$ psql -c "show data_directory"
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
b030bcb67163:~$

but nothing happen here

Dear Binaca,

since nobody else answered so far: i have never used the docker image, so i have to do some guessing here. To me, this looks as if in the docker image, the postgres server was not started and/or it was not initialized (via initdb) yet.

https://wiki.postgresql.org/wiki/First_steps

i would expect that the docker script would do so for you, but maybe something went wrong on this...

-gn