What is the image oraclelinux/postgres? No such Docker image is available on Docker Hub.
For Postgres, use the official image https://hub.docker.com/_/postgres/
thanks for your feedback. Didn’t knew that it was mandatory using a pre-build image from the hub. The idea is to build our own image with our best practices for the compilation and setup.
The oraclelinux/postgres image is a basic Oracle Linux 7.2 with Postgres Community installed in it. This image works fine as I can start a container based on it running bash and then manually create and operate Postgres databases in it.
When I try to “automate” that I getting the error above which is not Postgres related indeed. The issue seems to be having a script in the CMD parameter which starts with #!/bin/bash
What I do not understand is that bash is available in the image, so I get the not found error on it??
Looking to the CMD statement, I found that giving it in that form: CMD /tmp/run_pgaas.bash .........and not as a JSON array, makes it started with /bin/sh -c. I guess this is part which fails, but I can’t find why as /bin/sh is available in the image.
For the /bin/hash command to be available the image should be built from a Linux based image as specified in the FROM instruction. Is the oraclelinux/postgres image based on a Linux image?
I tested deeper and find out that it works also with CMD, but the issue comes from the volumes.
Basically if I run: docker run -dt --name=test1 -h test1 -e DBNAME=DB1 -e OPNAME=deploy -P
then it works fine.
If now I had volumes in it: docker run -dt --name=test1 -h test1 -e DBNAME=DB1 -e OPNAME=deploy -P --volumes-from=dbdata
then I get again the error: Container command ‘/bin/sh’ not found or does not exist…
Do you see reason why the the volumes would impact the command execution?