MatchbookLab / local-persist

Create named local volumes that persist in the location(s) you want
MIT License
852 stars 123 forks source link

Operation not permitted #50

Closed bat79a closed 6 years ago

bat79a commented 7 years ago

Hi.

My config use a VM with doker and an other VM with NFS packages.

My container works well with this config :

version: '2'

services:
  web:
    image: my_image
    restart: always
    ports:
      - "8888:8000"
    volumes:
      - /media:/srv/media

Inside the folder media I have a new folder uploads with my files created when I upload some images.

if I change for this one (inspired by your example) :

version: '2'

services:
  web:
    image: my_image
    restart: always
    ports:
      - "8888:8000"
    volumes:
      - media:/srv/media

volumes:
  media-files:
    driver: local-persist
    driver_opts:
      mountpoint: /home/bat/volume/media

I have this error :

ERROR: for web  Cannot create container for service web: chown /home/bat/volume/media-files: operation not permitted
ERROR: Encountered errors while bringing up the project.

A folder uploads is created in my host (and NFS server) inside the media folder, the docker volume is created, but the container is not running due to this error.

All folders have chmod 777 for the test.

Thx a lot.

Config :

# Docker version
Client:
 Version:      1.12.5
 API version:  1.24
 Go version:   go1.6.4
 Git commit:   7392c3b
 Built:        Fri Dec 16 02:42:17 2016
 OS/Arch:      linux/amd64

local-persist installation was made with curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sudo bash

CWSpear commented 7 years ago

It definitely seems like it's permissions related. Just because it's 777, I don't think that means you can do a chown. You may need to figure out who your Docker user is (i.e., did you set up a dedicated docker user?) and make sure he (or she) is the owner (or in the group) of the folders.

bat79a commented 7 years ago

Thx a lot, sure this is certainly my mistake ! I Will try this monday morning.

Thx again and have a good week-end.

CWSpear commented 6 years ago

Closing for inactivity.