docker invalid characters for local volume name

A few days ago, I installed docker on my new laptop. I’ve used docker for a while and know the basics pretty well. Yet, for some reason I keep bumping into the same problem and I hope someone here can help me.

After installing the Docker Toolbox on my Windows 10 Home laptop, I tried to run some images that I’ve created using a docker-compose.yml. Since my user directory on windows has my exact name in it (C:/Users/Nick van der Meij) and that name contains spaces, I added an extra shared folder from C:/code to /mnt/code on the Docker Host (this works). I’ve used this guide to do so

  • docker - installing java 8 with curl
  • How to connect to a SQL instance in an App Engine custom runtime Dockerfile?
  • Kubernetes - How to run kubectl commands inside a container?
  • Cannot deploy docker containers from different hosts
  • getUserMedia in Firefox in Docker not working when using audio
  • Is it possible to use a private git(hub) repo in Dockerfile ADD?
  • However, when I try to run my docker-compose.yml (included below), I get the following error:

    ERROR: for php  Cannot create container for service php: create \mnt\code\basic_php\api: "\\mnt\\code\\basic_php\\api" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed
    [31mERROR[0m: Encountered errors while bringing up the project.

    As far as I see it, everything seems to be correct according to the official docker docs about volumes. I’ve spend many hours trying to fix this and tried out multiple “formats” for the volumes tag, yet without any success.

    Does anyone know what the problem might be?

    Thanks in Advance!


    version: '2'
            image: mysql:5.7
                - 3306
                - /var/lib/mysql
            restart: always
                MYSQL_ROOT_PASSWORD: password
                MYSQL_USER: user
                MYSQL_PASSWORD: password
                MYSQL_DATABASE: database
            image: nginx:1.10.2
                - 80:80
                - 443:443
            restart: always
                - /mnt/code/basic_php/nginx/conf:/etc/nginx/conf.d
                - /mnt/code/basic_php/api:/code/api
                - /mnt/code/basic_php/nginx:/code/nginx
                - php
                - site
                - php
                - site
            build: php
                - 9000
            restart: always
                - /mnt/code/basic_php/php/conf/php.ini:/usr/local/etc/php/conf.d/custom.ini
                - /mnt/code/basic_php/api:/code/api
                - mysql
            restart: always
            build: site
                - 80
            container_name: site

  • How to deploy a echo app to Marathon (on Mesos on Docker on Mac)?
  • Error checking TLS connection with Docksal
  • How to set docker run arguments on marathon spec
  • Docker runs out of disk space even though containers are small
  • Install vim in node Docker image
  • Can I extend docker-compose files?
  • One Solution collect form web for “docker invalid characters for local volume name”

    After a few hours searching the web, I finally found what i was looking for. Like Wolfgang Blessen said in the comments below my question, the problem was indeed a Windows Path problem.

    If you dont want docker to automatically convert paths windows to unix, you need to add the COMPOSE_CONVERT_WINDOWS_PATHS environment variable with a value of 0 like explained here: link

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.