title: chown docker volumes on host (possibly through docker-compose)
body: <p>I have the following example</p>
  
  <pre><code>version: '2'
  
  services:
    proxy:
      container_name: proxy
      hostname: proxy
      image: nginx
      ports:
        - 80:80
        - 443:443
      volumes:
        - proxy_conf:/etc/nginx
        - proxy_htdocs:/usr/share/nginx/html
  
  volumes:
    proxy_conf: {}
    proxy_htdocs: {}
  </code></pre>
  
  <p>which works fine. When I run <code>docker-compose up</code> it creates those named volumes in <code>/var/lib/docker/volumes</code> and all is good. However, from the host, I can only access <code>/var/lib/docker</code> as root, because it's <code>root:root</code> (makes sense). I was wondering if there is a way of <code>chown</code>ing the host's directories to something more sensible/safe (like, my relatively unprivileged user that I use to do most things on the host) or if I just have to suck it up and <code>chown</code> them manually. I'm starting to have a number of scripts already to work around other issues, so having an extra couple of lines won't be much of a problem, but I'd really like to keep my self-written automation minimal, if I can -- fewer chances for stupid mistakes.</p>
  
  <p>By the way, no: if I mount host directories instead of creating volumes, they get overlaid, meaning that if they start empty, they stay empty, and I don't get the default configuration (or whatever) from inside the container.</p>
  
  <p>Extra points: can I just move the volumes to a more convenient location? Say, <code>/home/myuser/myserverstuff/volumes</code>?</p>