title: How to remove unnamed volumes when docker compose down?
body: <p>I have a docker-compose file which describes several services. All services have volumes attached to them, however only one has the volume named. When I run <code>docker compose down</code> I want to automatically delete the not named volumes while at the same time create all volumes that are missing.</p>
  <pre class="lang-yaml prettyprint-override"><code>services:
    service1:
      image: some/image:1
      volumes:
        - named-volume:/home/user1
  
    service2: 
      image:  some/image:2
      #volumes: not declared volumes that are named automatically with a hash
  
  volumes:
    named-volume:
      name: volume-for-service1
  </code></pre>
  <p>The first time I run <code>docker compose up</code> I want to automatically create all volumes (named and unnamed) and when I run <code>docker compose down</code> I want that unnamed volumes to be deleted while the named one (<code>volume-for-service1</code>) to be preserved. Next time I run <code>docker compose up</code> it should only create the unnamed volumes as the named one already exists.</p>
  <p>I have tried:</p>
  <ul>
  <li><code>docker compose down -v</code> which removed no volume</li>
  <li><code>docker compose down --remove-orphans</code> which removed no volume</li>
  <li><code>docker compose down --rmi local</code> which removed no volume</li>
  <li><code>docker-compose down -v</code> which removed the named volume</li>
  <li><code>docker-compose down --remove-orphans</code> which removed no volume</li>
  <li><code>docker-compose down --rmi local</code> which removed no volume</li>
  </ul>
  <p>OS: Windows 10 x64</p>
  <p>I don't quite get it. What command should I run to achieve desired results?</p>