Docker permissios shared Volume on mac

I have a permission problem with my mac and my docker (VirtualBox).

container command:

  • NodeJS Mongodb in docker compose = ECONNREFUSED
  • Cassandra docker access from host
  • Docker: Set container name inside Dockerfile
  • Docker hangs on the RUN command OSX
  • Docker Build and Multi layer dll version
  • Access service running in docker container from inside another docker container
  • docker run --name gbl -p 32770:80 -v /Users/sja/Sites/gbl:/var/www --link mariadb:db --link memcached:cache -td paimpozhil/magento-docker
    

    After that I run a simple php script which create a txt file in my root directory.

    $content = "some text here";
    $fp = fopen($_SERVER['DOCUMENT_ROOT'] . "/myText.txt","wb");
    fwrite($fp,$content);
    fclose($fp);
    

    The script not works because my php file have no permissions to create a new file.

    PHP Warning:  fopen(/var/www/myText.txt): failed to open stream: Permission denied in /var/www/test.php on line 3
    

    My username and group looks like this

    enter image description here

    When I try to change it to root nothing happens

    chown root.root -R . 
    

    enter image description here

    What is wrong with my container and my permissions? It is possible that docker override my user and group because I use a shared folder?

  • Only certain files uploading in PHP (running Docker for Windows)
  • What is the reason for various “executable file not found in $PATH” errors?
  • How can I run configuration commands after startup in Docker?
  • Can't npm install dependencies when building docker image
  • HDP 2.5 Hortonworks ambari-admin-password-reset missing
  • Importance of the place of CMD in Dockerfile
  • One Solution collect form web for “Docker permissios shared Volume on mac”

    Dinghy solve my problem! Works like a charm!

    https://github.com/codekitchen/dinghy

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.