Docker Community Forums

Share and learn in the Docker community.

Docker Compose Error "Duplicate mount point"

Hi,
I followed the tutorial to get startet with docker compose.
I tried to add a named volume to the docker-compose.yml

version: "3.9"
services:
  web:
    build: .
    ports:
      - "5001:5000"
    volumes:
      - tst:/d/examples/docker_volumes/Test/
  redis:
    image: "redis:alpine"
volumes:
  tst:

When I run docker compose up everything is fine and the volume gets created. When I run docker compose up again everything is still fine.

Now I modified the docker-compose.yml (I modified the port) and when I run docker compose up again I get the following error:

Error response from daemon: Duplicate mount point: /d/examples/docker_volumes/Test/

When I cleanup everything with docker compose down -v and restart everything is fine.

:arrow_right: Do I really need to cleanup everytime I modify the YML-File?