Docker permissios shared Volume on mac

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

container command:

  • Docker data volumes and scaling in a distributed system
  • Docker Entrypoint script cannot get $DB_PORT_3306_TCP_ADDR environment variable
  • How to manage command line arguments in docker run command?
  • Docker Swarm Fault-tolerant Scheduling
  • Docker failover: Redis, MySQL and Nginx
  • Docker Jboss/wildfly: How to add datasources and MySQL connector
  • 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");

    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?

  • Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  • Chef Test Kitchen verify file exists inside Docker container
  • IntelliJ autocompletion and docker
  • Installing Jenkins Plugins to Docker Jenkins
  • pip install pymssql from inside docker container
  • How to create and start a container through docker API
  • One Solution collect form web for “Docker permissios shared Volume on mac”

    Dinghy solve my problem! Works like a charm!

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