Skip to content

chmod: changing permissions of 'var/lib/postgresql/data': Permission denied #116

Description

@pueffl

I have slightly extended the official postgres Image in the following way (only the COPY is really important, to do some stuff to use SonarQube with Postgres):

Version: 1.0.0

FROM postgres:9.5
MAINTAINER Wolfgang Grossinger "wolfgang.grossinger@gmail.com"
COPY sonarqube.sql /docker-entrypoint-initdb.d
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
ENV POSTGRES_PASSWORD=postgres
ENV POSTGRES_USER=postgres
RUN chmod 777 /var/lib/postgresql/data

After building the image I try to start it with the following command:

sudo docker run --name postgres_sonar -p 5432:5432 -v /data:/var/lib/postgresql/data wogro/postgres_sonar

I get the following error message:

chmod: changing permissions of ‘/var/lib/postgresql/data’: Permission denied

I don't know what the reason is (probably it's me), but it is something i would never expect from an official image (I just would expect that mounting a volume works :-))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions