Mount error on Windows 10

I am trying to use a docker compose file on windows 10 with a mount but getting a error:

Error response from daemon: invalid mount config for type "volume": invalid mount path: 'C:/Users/Public/grafana' mount path must be absolute

The docker compose file looks like:

services:
  grafana:
    image: grafana/grafana
    container_name: grafana
    restart: always
    ports:
      - 3000:3000
    networks:
      - test
    volumes:
      - "C:/Users/Public/grafana"
  influxdb:
    image: influxdb
    container_name: influxdb
    restart: always
    ports:
      - 8086:8086
    networks:
      - test
    volumes:
      - "C:/Users/Public/influxdb"
networks:
  test:
volumes:
  grafana-volume:
    external: true
  influxdb-volume:
    external: true

The path exists - so I am unsure what is wrong here.

I admit the error message is not obvious, but you have no source path in your compose file, only a destination for an anonymous volume. I’m not sure what your goal was. That definition would only work probbaly with Windows containers, but if the Windows path is on the host, you need to define source path and a destination separated by a colon or use the long syntax. The desitnation is the path where you want to mount the source path into the Linux container.

You can find examples here. I recommend the long syntax:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.