title: PostgreSQL in Openshift won't execute the entrypoint and can not start the database
body: <p>We have a read-only Postgresql database that should run in Openshift cluster.
  We are using RHEL as the undrlying operating system.
  Our Dockerfile will install postgres software,  create the database instance, loads the data to it than shuts the database down and save the image.
  We are using only bash and sql scripts and deploy the database using flyway.</p>
  
  <p>When starting the container the entrypoint script will simply startup the database instance using <code>"pg_ctl"</code> command  then perform an endless loop to keep the container running. </p>
  
  <p>The Dockerfile has as the last command USER 26, where 26 is the id of the postgres user. The entrypoint script can be started as the postgres user or by a <code>sudo user</code>.</p>
  
  <p>Everything is working well in Docker.</p>
  
  <p>In Openshift the container is started by a different user belonging to the root group, but not the root user nor the user 26. Actually Openshift ignores the USER 26 clause in the Dockerfile.
  The user starting the container (we'll call it containeruser) has anyhow no rights to start the postgres instance , so when running the entrypoint it will get permission denied on the postgresql data folder.
  I have tried different options, adding the containeruser user to the wheel group and modify the sudoers file to allow it using sudo and start the entrypoint as postgres user but with no success.
  So I have my database image ready but can not start it in Openshift.
  On the openshift configuration side we are not allowed to make changes like allowing sudo usage, or starting the container as root or postgres user.</p>
  
  <p>Any idea or help to this problem?
  I am not an Openshift expert.</p>
  
  <p>Thank you!</p>
  
  <p>Best regards,
  rimetnac</p>