I am absolutely new to Docker. I followed steps described in Docker Compose's "Getting Started" tutorial:
- Install Docker Toolbox
- Start Docker Quickstart Terminal
- Add project files
- Run
docker-compose up
command
And I got following error:
ERROR: for web Cannot create container for service web: Invalid bind mount spec "D:\\Projects\\composetest:/code:rw": Invalid volume specification: 'D:\Projects\composetest:/code:rw'
[31mERROR[0m: Encountered errors while bringing up the project.
docker-compose.yml:
version: '2'
services:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code:rw
redis:
image: "redis:alpine"
Project structure:
D:\Projects\composetest
├── app.py
├── docker-compose.yml
├── Dockerfile
└── requirements.txt
My configuration:
- Windows 10 Single Language
- Docker Toolbox 1.12.5
Why does it happen? Is there some workaround?
I found the solution. The problem was I didn't set the environment variable
COMPOSE_CONVERT_WINDOWS_PATHS
. It is described in the CLI variables doc.So, if this problem exists, you should create new Windows environment variable called
COMPOSE_CONVERT_WINDOWS_PATHS
and set it to1
. Or you can create.env
file in the pathdocker-compose.yml
is placed with following content:It will solve this problem.