title: How can I create a volume for the current user home directory in docker-compose?
body: <p>For the docker image <code>v2tec/watchtower</code> I must provide the user-specific docker configuration file <code>config.json</code>. I am currently doing this as following:</p>
  
  <pre><code>version: "3"
  services:
      watchtower:
      image: v2tec/watchtower
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - /home/thefrozenyoghurt/.docker/config.json:/config.json
  </code></pre>
  
  <p>This works on my machine. But I want to distribute this <code>docker-compose.yml</code> to my colleagues so they can use it also. This won't work with the <code>docker-compose.yml</code> above, as my home directory is hardcoded.</p>
  
  <p>Is it possible to refer to the user home directory in a <code>docker-compose.yml</code>? I cannot find such functionalities in the documentation. I think I need something like:</p>
  
  <pre><code>version: "3"
  services:
      watchtower:
      image: v2tec/watchtower
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - $HOME/.docker/config.json:/config.json
  </code></pre>