adlogix / docker-machine-nfs

Activates NFS on docker-machine
MIT License
794 stars 104 forks source link

Permission Denied on 2nd build #59

Closed raptor235 closed 7 years ago

raptor235 commented 8 years ago

Hey guys could use some help here.. got everything working properly.. I'm also exposing mariadb to a mounted volume so data is persistent.

The problem is I can set everything up... run docker-compose build, then docker-compose up, I see the db folder gets built by mariadb (those files are restricted to osx root only user) and things are running fine.

However when I run another docker-compose build command I run into issues from my php container complaining about access to the db folder which is setup from mariadb container... I'm not sure if this has something to do with /etc/exports and permissions of that folder but I can't build anything else unless I delete the db folder in the root...

I'm not sure if any of the options for docker-machine-nfs will help with this issue...

`#docker-machine ip default

web:
    build: .
    container_name: web
    ports:
        - "9090:80"
    volumes:
        - /Users/bartdabek/Sites/hgv/hgv_data/sites/:/code
        - ./site.conf:/etc/nginx/conf.d/site.conf
        - ./nginx.conf:/etc/nginx/nginx.conf
        - ./sites-enabled:/etc/nginx/sites-enabled
    links:
        - php
        #- mariadb
        - memcached
php:
    container_name: php
    build: .
    dockerfile: Dockerfile-php
    volumes:
        - /Users/bartdabek/Sites/hgv/hgv_data/sites/:/code
        - ./Tideways.php:/usr/local/lib/php/extensions/no-debug-non-zts-20151012/Tideways.php
    links:
        #- mariadb
        - memcached
memcached:
  container_name: memcached
  image: sameersbn/memcached:latest
  ports:
    - "11211:11211"
  restart: always
mariadb:
  container_name: mariadb
  image: mariadb
  volumes:
    - /Users/bartdabek/Sites/docker/db/:/var/lib/mysql
  environment:
    DB_ADMIN_PASS: pass
    MYSQL_ROOT_PASSWORD: root
  ports:
    - "3306:3306"
`

image

image

raptor235 commented 8 years ago

Basically I need to change permissions back on the db folder to get things to build again

drwxr-xr-x  11 bartdabek  staff    374 19 May 00:02 .
drwxr-xr-x  13 bartdabek  staff    442 16 May 15:36 ..
-rw-r--r--   1 bartdabek  staff    365 18 May 22:58 Dockerfile
-rw-r--r--   1 bartdabek  staff    267 18 May 22:26 Dockerfile-data
-rw-r--r--   1 bartdabek  staff   1642 18 May 23:06 Dockerfile-php
-rw-r--r--@  1 bartdabek  staff  43748 17 May 21:44 Tideways.php
drwxr-xr-x  11 999        999      374 19 May 00:02 db
-rw-r--r--   1 bartdabek  staff   1006 19 May 00:02 docker-compose.yml
-rw-r--r--   1 bartdabek  staff    743 18 May 23:09 nginx.conf
-rw-r--r--   1 bartdabek  staff    508 16 May 15:38 site.conf
drwxr-xr-x   3 bartdabek  staff    102 18 May 23:13 sites-enabled
arobd commented 8 years ago

@raptor235 , What if you mount NFS with this option- docker-machine-nfs <machine_name> --nfs-config="-alldirs -maproot=0"

tonivdv commented 7 years ago

@raptor235 Do you still have issues?