title: Wrong permissions in volume in Docker container
body: <p>I run Docker 1.8.1 in OSX 10.11 via an local docker-machine VM.</p>
  
  <p>I have the following docker-compose.yml:</p>
  
  <pre><code>web:
      build: docker/web
      ports:
          - 80:80
          - 8080:8080
      volumes:
          - $PWD/cms:/srv/cms
  </code></pre>
  
  <p>My Dockerfile looks like this:</p>
  
  <pre><code>FROM alpine
  
  # install nginx and php
  RUN apk add --update \
      nginx \
      php \
      php-fpm \
      php-pdo \
      php-json \
      php-openssl \
      php-mysql \
      php-pdo_mysql \
      php-mcrypt \
      php-ctype \
      php-zlib \
      supervisor \
      wget \
      curl \
      &amp;&amp; rm -rf /var/cache/apk/*
  
  RUN mkdir -p /etc/nginx &amp;&amp; \
      mkdir -p /etc/nginx/sites-enabled &amp;&amp; \
      mkdir -p /var/run/php-fpm &amp;&amp; \
      mkdir -p /var/log/supervisor &amp;&amp; \
      mkdir -p /srv/cms
  
  RUN rm /etc/nginx/nginx.conf
  ADD nginx.conf /etc/nginx/nginx.conf
  ADD thunder.conf /etc/nginx/sites-enabled/thunder.conf
  
  ADD nginx-supervisor.ini /etc/supervisor.d/nginx-supervisor.ini
  
  WORKDIR "/srv/cms"
  VOLUME "/srv/cms"
  
  EXPOSE 80
  EXPOSE 8080
  EXPOSE 22
  
  CMD ["/usr/bin/supervisord"]
  </code></pre>
  
  <p>When I run everything with <code>docker-compose up</code> everything works fine, my volumes are mounted at the correct place.</p>
  
  <p>But the permissions in the mounted folder /srv/cms look wrong. The user is "1000" and the group is "50" in the container. The webserver could not create any files in this folder, because it runs with the user "root".</p>