Skip to content

initdb: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted #563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lluck42 opened this issue Mar 26, 2019 · 3 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@lluck42
Copy link

lluck42 commented Mar 26, 2019

window 10 hyperv
use minikube

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: postgres
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: postgres
    spec:
      containers:
      - name: postgres
        image: postgres:11.2-alpine
        ports:
        - containerPort: 5432
        volumeMounts:
        - mountPath: /var/lib/postgresql/data
          name: postgres-data
        env:
        - name: POSTGRES_PASSWORD
          value: a.123456
      volumes:
        - name: postgres-data
          hostPath:
            path: /f/postgres/data

result:

initdb: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted
fixing permissions on existing directory /var/lib/postgresql/data ...
@wglambert wglambert added the question Usability question, not directly related to an error with the image label Mar 26, 2019
@wglambert
Copy link

A Kubernetes persistent volume uses NFS, so ensure you have proper permissions set for the user in the container (which is postgres).
I think this comment is what you're looking for
#361 (comment)

There might also be an issue with Minikube and mounting host folders, although in this instance I'm not sure since you're using hyper-v
#560 (comment)

@lluck42
Copy link
Author

lluck42 commented Mar 28, 2019

you see, install postgres is one-step operate, but if use docker , i face the problem in 'postgres/data',
I try to search a way to across the trouble. but, It seems to have failed. I cannot but go back to the mysql docke...

@tianon
Copy link
Member

tianon commented Apr 4, 2019

I'm sorry you're having issues, but this is really not the right place to look for support. For help figuring out what's going on with your environment/setup, I'd recommend trying the Docker Community Forums, the Docker Community Slack, or Stack Overflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

3 participants