I'm trying to start PostgreSQL 11 as postgres
user on a Debian 8.6 base system:
FROM xxx.amazonaws.com/groen/debian-jessie
ENV DEBIAN_FRONTEND noninteractive
ADD powerUp /etc/my_runalways/startup-postgresql
RUN chmod -R 700 /etc/my_runalways/startup-postgresql
RUN sed -i '/updates/d' /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y -q install wget
RUN apt-get --force-yes -y -q install postgresql-11 postgresql-client-11
USER postgres
RUN /etc/init.d/postgresql start
but I'm experiencing a seemingly unrelated permission error originating in a config.json
file:
Step 10/17 : RUN apt-get -y -q install postgresql-11 postgresql-client-11
---> Using cache
---> 676bf87b8145
Step 11/17 : USER postgres
---> Using cache
---> e54a93b7ba49
Step 12/17 : RUN /etc/init.d/postgresql start
---> Running in 50d6fa1c1825
OCI runtime create failed: container_linux.go:345: starting container process caused "chdir to cwd (\"/root\") set in config.json failed: permission denied": unknown
I'm a bit bewildered by this message as this file exists on the host whereas this error happens inside the container (more correctly when building the image).
Working with a slimmed down version of the build, and logging in the resulting container, I try to emulate the error by manually executing the commands. This gives no errors however:
postgres@10f5e189ca95:~$ groups
postgres ssl-cert
postgres@10f5e189ca95:~$ ls -lrta /etc/init.d/postgresql
-rwxr-xr-x 1 root root 1490 Feb 21 2016 /etc/init.d/postgresql
postgres@10f5e189ca95:~$ /etc/init.d/postgresql start
[ ok ] Starting PostgreSQL 11 database server: main.
postgres@10f5e189ca95:~$ /etc/init.d/postgresql status
11/main (port 5432): online
postgres@10f5e189ca95:~$