Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading Docker Toolbox and Compose on Windows stopped volume bindings from working. #4274

Closed
shamil8124 opened this issue Dec 26, 2016 · 13 comments

Comments

@shamil8124
Copy link

shamil8124 commented Dec 26, 2016

I just recently upgraded to the latest docker toolbox and compose versions, and now my volume bindings are no longer working. I receive an "invalid bind mount spec" error when trying to build my container. Here is my compose file:

version: '2'
services:
  fatbot:
    build:
      context: ./
      dockerfile: ./Dockerfile
    container_name: fatbot
    ports:
      - "80:80"
    volumes:
      - C:\Users\shamil8124\Desktop\backend:/var/www/html
    command: /usr/sbin/apache2ctl -D FOREGROUND

And the error:

ERROR: for fatbot  Cannot create container for service fatbot: Invalid bind mount spec "C:\\Users\\shamil8124\\Desktop\\backend:/var/www/html:rw": Invalid volume specification: 'C:\Users\shamil8124\Desktop\backend:/var/www/html:rw'

Apologies if this isn't the right place to ask for help with this. I've been lost for the past few days, and the docker forums along with Stackoverflow have not helped.

@mirorauhala
Copy link

mirorauhala commented Dec 29, 2016

I'm getting the same error as well but with a different docker-compose.yml file.

My file is as follows:

version: '2'
services:
    app:
        build:
            context: ./
            dockerfile: ./Dockerfile
        volumes:
            - ./:/var/www

The output of docker-compose up -d is:

ERROR: for app  Cannot create container for service app: Invalid bind mount spec "C:\\app:/var/www:rw": Invalid volume specification: 'C:\app:/var/www:rw'

I've understood that there is no such issue on the native Docker for Windows app which uses Hyper-V instead of VirtualBox. However, I'm not in the mood to upgrade my Windows 10 Home to Windows 10 Pro.

I hope there is a solution to this.

@shamil8124
Copy link
Author

shamil8124 commented Dec 29, 2016

@mirorauhala I managed to have it working by downgrading my Docker Toolbox setup. I'm currently running version 1.12.0. If you download and run it, it will downgrade your "Compose," and it should get things working again.

Here's the link: https://github.com/docker/toolbox/releases/tag/v1.12.0

@mirorauhala
Copy link

Will try! Thanks for the advice @shamil8124

@nathanleclaire
Copy link

This is with 1.12.5 Toolbox and Compose?

Can you please try the 1.13.0-rc4 https://github.com/docker/toolbox/releases/tag/v1.13.0-rc4 ?

There is an environment variable, COMPOSE_CONVERT_WINDOWS_PATHS, which Machine 0.9.0 will set automatically, but 0.8.2 will not.

I bundled the latest stable version of Compose (1.9.0) in the 1.12.5 Toolbox, maybe this version breaks backwards compatibility.

@shamil8124
Copy link
Author

Yeah it was with 1.12.5. I'll upgrade soon and let you know. Thank you. :)

@mirorauhala
Copy link

@nathanleclaire will do. The older version which @shamil8124 suggested to install failed during the VM setup. Hopefully the rc4 works.

@nathanleclaire
Copy link

FWIW, If you keep hitting VM setup woes, you might want to try removing VMs and uninstalling VirtualBox, and re-installing the ToolBox (which will install VBox again). Make sure your system has latest Windows updates, too.

@mirorauhala
Copy link

@nathanleclaire yup. Just removed everything. My win10 has automatic updates on. Downloaded the latest virtualbox from their website. (did a reboot in between just to be super cautious). Now installing rc4... wish me luck

@nathanleclaire
Copy link

Good luck have fun 😄 🍀

@mirorauhala
Copy link

Sadly, it still fails with the same error Cannot create container for service app: invalid bind mount spec.

@mirorauhala
Copy link

YEY! Got it working in the Docker CLI powershell.

Just needed to set the environment variable before running docker-compose.

Run this in powershell.

$env:COMPOSE_CONVERT_WINDOWS_PATHS=0

If you set the value to 1 it still works, just like mentioned in #4240.

@nathanleclaire
Copy link

Hm, if 0.9.0-rc2 doesn't set COMPOSE_CONVERT_WINDOWS_PATHS for the other shells, that's a bug. I'll have to look into that.

@nathanleclaire
Copy link

0.9.0-rc2 should set that value in powershell just fine using --shell powershell:

$ docker-machine env --shell powershell
$Env:DOCKER_TLS_VERIFY = "1"
$Env:DOCKER_HOST = "tcp://192.168.99.100:2376"
$Env:DOCKER_CERT_PATH = "C:\Users\nathanleclaire\.docker\machine\machines\default"
$Env:DOCKER_MACHINE_NAME = "default"
$Env:DOCKER_API_VERSION = "1.25"
$Env:COMPOSE_CONVERT_WINDOWS_PATHS = "true"
# Run this command to configure your shell:
# & "C:\Program Files\Docker Toolbox\docker-machine.exe" env --shell powershell | Invoke-Expression

I'd recommend this issue be closed @shin- @dnephin ... Seems likely that everything should be OK in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants