I have a docker-compose yml file which is giving me the following error:
ERROR: Volume <path>db:/db:rw has incorrect format, should be external:internal[:mode]
I’ve seen multiple posts about this issue but never a resolution. Working on macOS with the following yml file:
volumes:
db:
rdb:
services:
volumes-provisioner:
image: hasnat/volumes-provisioner
environment:
PROVISION_DIRECTORIES: "1001:1001:0755:/db"
volumes:
- "./db:/db:rw"
volumes-provisioner2:
image: hasnat/volumes-provisioner
environment:
PROVISION_DIRECTORIES: "999:999:0755:/data"
volumes:
- "./rdb:/data:rw"
redis:
image: "redislabs/redisgraph:2.2.6"
ports:
- "6379:6379"
volumes:
- "./rdb:/data:rw"
depends_on:
- volumes-provisioner2
insight:
image: "redislabs/redisinsight:1.7.1"
depends_on:
- volumes-provisioner
- redis
volumes:
- "./db:/db:rw"
ports:
- "8001:8001"
Any ideas?
2
Answers
It’s probably your version of docker. Make sure you’ve upgraded to latest, then add a docker version statement to the top of your file (version: "3.9"). I’ve modified your file below to include this, and I also removed the quotes around the images. After that it works.
I got this error when I was running
docker-compose
from a Windows Subsystem for Linux (WSL) terminal running on Windows. If I rundocker-compose
from Windows Powershell, it works.