I am working on setting up Postgres 9.5 AS in Docker, and got everything installed. The issue however is, when I start the Docker Container, it appears that Postgres starts at first, but then the Container stops right away. (it does not show up with a docker container ls
.). When I overwrite the Container startup with --entrypoint sh
, and manually start Postgres, it all works fine.
I also checked with docker logs <container-id>
, but that does not give me any info at all.
The setup is like this :
Dockerfile :
ENTRYPOINT ["/opt/edb/9.5AS/bin/init.sh"]
init.sh :
su enterprisedb -c '/opt/edb/9.5AS/bin/pg_ctl start -D /opt/edb/9.5AS/data'
From my command prompt I run :
docker run -it -v pgdata:/opt/edb/9.5AS/data <image_name>
It almost looks like it does start, but as soon as the start process is done, the shell stops, and as a result the Container stops as well.
So how to get it so the Container starts, Postgres starts and everything stays running, preferable in detached mode of course?