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

docker-compose fails to mount volumes on docker-machine (linux) host. #423

Closed
JettJones opened this issue Jan 24, 2017 · 5 comments
Closed

Comments

@JettJones
Copy link

JettJones commented Jan 24, 2017

Expected behavior

Using an existing docker-compose file, which works in docker 1.12 - I should be able to mount a volume from the docker host. The larger use case is to mount the docker-socket, for running something like registrator or logspout, but this issue reproduces with any bind mount.

Actual behavior

It seems that docker-compose for windows is doing some windows-specific path mangling, which fails because my docker host is a linux VM run by docker-machine.

This is the error returned:

ERROR: for dock  Cannot create container for service dock: create \tmp: "\\tmp" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intented to pass a host directory, use absolute path
ERROR: Encountered errors while bringing up the project.

Information

>docker-compose --version
docker-compose version 1.10.0, build 4bd6f1a0
  • a reproducible case if this is a bug, Dockerfiles FTW
version: '2'
services:
  dock:
    image: alpine
    volumes:
      - "/tmp:/mounted_tmp"
    tty: true
  • host distribution and version (Windows version, build number, etc)
    windows 10 pro, Version 1607 (OS Build 14292.693)
>docker-machine --version
docker-machine version 0.9.0, build 15fd4c7

within the docker-machine install:

Boot2Docker version 1.13.0, build HEAD : 5b8d9cb - Wed Jan 18 18:50:40 UTC 2017
Docker version 1.13.0, build 49bf474

Steps to reproduce the behavior

  1. docker-compose -f {the_file_above} up
@friism
Copy link

friism commented Jan 24, 2017

You should make sure that the environment variable COMPOSE_CONVERT_WINDOWS_PATHS is false: https://github.com/docker/compose/releases/tag/1.10.0

If you encounter further problems, please follow up on the docker compose repo (or possibly on Toolbox or Boot2docker).

@friism friism closed this as completed Jan 24, 2017
@JettJones
Copy link
Author

Thanks, with the name of the setting, I found a tracking issue already on compose: docker/compose#4240

Setting the value to false or 0 still fails with the same error about the volume name. 1 and true are what the setting needs to be. (Seemingly the name is backwards)

set COMPOSE_CONVERT_WINDOWS_PATHS=1

Also toolbox is Legacy and doesn't have a 1.13 release.

@friism
Copy link

friism commented Jan 24, 2017

@JettJones there's a 1.13 toolbox release: https://github.com/docker/toolbox/releases/tag/v1.13.0

@JettJones
Copy link
Author

JettJones commented Jan 24, 2017

oh, I didn't realize - both of the download links I found were for 1.12.6, so combined with the Legacy tag in the docs, I assumed that meant no more updates.

https://www.docker.com/products/docker-toolbox
https://docs.docker.com/toolbox/toolbox_install_windows/

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants