-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Can't mount a volume on Windows 7 #607
Comments
I have the same problem with Docker Toolbox on Windows 10.
docker-compose.yml (part that fails): volumes_source:
image: tianon/true
volumes:
- ./:/var/www/laravel EDIT: Downgrading to Docker Toolbox 1.2.0 is a workaround. |
I have the same problem on Windows 7 too with the 1.12.5 release. ERROR: for mysql Cannot create container for service mysql: Invalid bind mount spec "C:\\www\\docker\\mysql:/var/lib/mysql:rw": Invalid volume specification: 'C:\www\docker\mysql:/var/lib/mysql:rw' ERROR: Encountered errors while bringing up the project. Here the line fails in my docker-compose.yml: volumes: - ./mysql:/var/lib/mysql I tried 1.12.4 release, it's the same problem. |
Same problem on Windows 10 with Docker Toolbox 1.12.5. Fixed by downgrading to Docker Toolbox 1.12.3 (did not attempt 1.12.4). |
👍 Have any one tried v1.13.0-rc4? EDIT |
This bug from docker-compose Docker Toolbox 1.12.3 include docker-compose |
It's from breaking changes in Docker Compose 1.9.0 that need to set additional env variable for Docker Toolbox. https://github.com/docker/compose/releases/tag/1.9.0 |
Thanks @aimakun! Setting |
@aimakun thank you! It works now! =) |
@leocavalcante Where have you gotten the 1.12.3 version? I cannot find it. Thanks! |
@jaroslavzivny Setting |
I downgraded to 1.12.3 and 1.8.1 for docker-compose, but i still run into issues : i now have "
I tried several things, for the path : with '/', with '//', with only '.:/var/www/html', and more... Any other ideas that could help ? |
@dargoan You need to "translate" your Win path to a Unix-like: What is happening is that you are using two ":" then Docker guesses as: But this third part should be the mode, so Docker errors with: If you are using Git Bash or Docker Quickstart Terminal, then volumes:
- ./:/var/www/html |
Thanks for the quick answer @leocavalcante (amazing!) ! This is true, i read that but forgot. I tried, but now, it tells me 'Cannot create container for service app: The working directory 'C:/Program Files/Git/var/www/html' is invalid. It needs to be an absolute path. I already had this error message, but I don't see why Docker talks about my Git directory... |
You need to put a slash before docker run -v /$PWD:/var/www/html -p 8000:80 php:apache |
Thanks again! Well, for now Now, I'm getting this error message : |
In the version: '2'
services:
web:
image: php:apache
volumes:
- ./:/var/www/html
ports:
- "8000:80" For a more concrete example: https://github.com/leocavalcante/siler-todo/blob/master/docker-compose.yml |
Well, this is not working neither with relative paths. I'am a Windows 7 user by the way. You're on mac @leocavalcante ? Any idea why ? |
But one thing is sure: it did run the command i wanted : composer install => no /vendor directory in my current folder. |
How is your docker-compose.yml file? Is it at 03-docker folder? |
@leocavalcante , my docker-compose file is like that : version: '2'
services:
app:
build:
context: ./docker/app
dockerfile: Dockerfile
image: dargoan/app
volumes:
- ./:/var/www/html
ports:
- "80:80"
networks:
- sdnet
node:
build:
context: ./docker/node
dockerfile: Dockerfile
image: dargoan/node
volumes:
- ./:/var/www/html
networks:
- sdnet
mysql:
image: mysql:5.7
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: "secret"
MYSQL_DATABASE: "homestead"
MYSQL_USER: "homestead"
MYSQL_PASSWORD: "secret"
volumes:
- mysqldata:/var/lib/mysql
networks:
- sdnet
redis:
image: redis:alpine
volumes:
- redisdata:/data
networks:
- sdnet
networks:
sdnet:
driver: "bridge"
volumes:
mysqldata:
driver: "local"
redisdata:
driver: "local" So, as a recap :
What do you think ? Is this related to an issue with the -w param ? |
It seams that Docker is using path at docker-compose run --rm -d -w //var/www/html app composer install |
Ok, it seems better now, but nonetheless, it doesn't the command But, when I added compose.config.config.find: Using configuration files: .\docker-compose.yml
docker.auth.auth.find_config_file: Trying paths: ['C:\\Users\\jct\\.docker\\config.json', 'C:\\Users\\jct\\.dockercfg']
docker.auth.auth.find_config_file: Found file at path: C:\Users\jct\.docker\config.json
docker.auth.auth.load_config: Found 'auths' section
docker.auth.auth.parse_auth: Found entry (registry=u'https://index.docker.io/v1/', username=u'dargoan')
compose.cli.command.get_client: docker-compose version 1.8.1, build 004ddae
docker-py version: 1.10.3
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2h 3 May 2016
compose.cli.command.get_client: Docker base_url: https://192.168.99.100:2376
compose.cli.command.get_client: Docker version: KernelVersion=4.4.27-boot2docker, Os=linux, BuildTime=2016-10-26T23:26:11.105168198+00:00, ApiVersion=1.24, Version=1.12.3, GitCommi
t=6b644ec, Arch=amd64, GoVersion=go1.6.3
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- (u'beregistration_sdnet')
compose.network.ensure: Creating network "beregistration_sdnet" with driver "bridge"
compose.cli.verbose_proxy.proxy_callable: docker create_network <- (ipam=None, driver='bridge', options=None, name=u'beregistration_sdnet')
compose.cli.verbose_proxy.proxy_callable: docker create_network -> {u'Id': u'b8c255a89dac95d9041cf8f274ea8ec1f376e7ee6e6d206c5b50c769ddacb7b4',
u'Warning': u''}
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume <- (u'beregistration_redisdata')
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume -> {u'Driver': u'local',
u'Labels': None,
u'Mountpoint': u'/mnt/sda1/var/lib/docker/volumes/beregistration_redisdata/_data',
u'Name': u'beregistration_redisdata',
u'Scope': u'local'}
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume <- (u'beregistration_redisdata')
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume -> {u'Driver': u'local',
u'Labels': None,
u'Mountpoint': u'/mnt/sda1/var/lib/docker/volumes/beregistration_redisdata/_data',
u'Name': u'beregistration_redisdata',
u'Scope': u'local'}
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume <- (u'beregistration_mysqldata')
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume -> {u'Driver': u'local',
u'Labels': None,
u'Mountpoint': u'/mnt/sda1/var/lib/docker/volumes/beregistration_mysqldata/_data',
u'Name': u'beregistration_mysqldata',
u'Scope': u'local'}
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume <- (u'beregistration_mysqldata')
compose.cli.verbose_proxy.proxy_callable: docker inspect_volume -> {u'Driver': u'local',
u'Labels': None,
u'Mountpoint': u'/mnt/sda1/var/lib/docker/volumes/beregistration_mysqldata/_data',
u'Name': u'beregistration_mysqldata',
u'Scope': u'local'}
compose.cli.verbose_proxy.proxy_callable: docker inspect_image <- ('dargoan/app')
compose.cli.verbose_proxy.proxy_callable: docker inspect_image -> {u'Architecture': u'amd64',
u'Author': u'Johan Chouquet',
u'Comment': u'',
u'Config': {u'ArgsEscaped': True,
u'AttachStderr': False,
u'AttachStdin': False,
u'AttachStdout': False,
u'Cmd': [u'/usr/bin/supervisord'],
u'Domainname': u'',
u'Entrypoint': None,
...
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=True, filters={u'label': [u'com.docker.compose.project=beregistration', u'com.docker.compose.service=app', u'com
.docker.compose.oneoff=True']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker containers <- (all=False, filters={u'label': [u'com.docker.compose.project=beregistration', u'com.docker.compose.service=app', u'co
m.docker.compose.oneoff=False']})
compose.cli.verbose_proxy.proxy_callable: docker containers -> (list with 0 items)
compose.cli.verbose_proxy.proxy_callable: docker create_host_config <- (cap_add=None, links=[], devices=None, pid_mode=None, log_config={'Type': u'', 'Config': {}}, cpu_quota=None,
read_only=None, dns=None, volumes_from=[], port_bindings={}, security_opt=None, extra_hosts=None, cgroup_parent=None, network_mode=u'beregistration_sdnet', shm_size=None, tmpfs=No
ne, memswap_limit=None, restart_policy=None, dns_search=None, privileged=False, binds=[u'/c/users/jct/code/03-docker/shippingdocker/be-registration/be-registration:/var/www/html:rw
'], ipc_mode=None, mem_limit=None, cap_drop=None, ulimits=None)
compose.cli.verbose_proxy.proxy_callable: docker create_host_config -> {'Binds': [u'/c/users/jct/code/03-docker/shippingdocker/be-registration/be-registration:/var/www/html:rw'],
'Links': [],
'LogConfig': {'Config': {}, 'Type': u''},
'NetworkMode': u'beregistration_sdnet',
'PortBindings': {},
'VolumesFrom': []}
compose.cli.verbose_proxy.proxy_callable: docker create_container <- (tty=False, labels={u'com.docker.compose.version': u'1.8.1', u'com.docker.compose.container-number': '1', u'com
.docker.compose.service': u'app', u'com.docker.compose.project': u'beregistration', u'com.docker.compose.oneoff': u'True'}, name=u'beregistration_app_run_1', image='dargoan/a
pp', stdin_open=False, host_config={'NetworkMode': u'beregistration_sdnet', 'Links': [], 'PortBindings': {}, 'Binds': [u'/c/users/jct/code/03-docker/shippingdocker/be-registration/
be-registration:/var/www/html:rw'], 'LogConfig': {'Type': u'', 'Config': {}}, 'VolumesFrom': []}, environment=[], working_dir='//var/www/html', command=['composer', 'install'], vol
umes={u'/var/www/html': {}}, detach=True, ports=[], networking_config={u'EndpointsConfig': {u'beregistration_sdnet': {u'IPAMConfig': {}, u'Aliases': ['app']}}})
compose.cli.verbose_proxy.proxy_callable: docker create_container -> {u'Id': u'0df53c5ae127ae0b9cc5deeb34c54b028a0a464e7288e0119131624f66ba0a09',
u'Warnings': None}
compose.cli.verbose_proxy.proxy_callable: docker inspect_container <- (u'0df53c5ae127ae0b9cc5deeb34c54b028a0a464e7288e0119131624f66ba0a09')
compose.cli.verbose_proxy.proxy_callable: docker inspect_container -> {u'AppArmorProfile': u'',
u'Args': [u'install'],
u'Config': {u'AttachStderr': False,
u'AttachStdin': False,
u'AttachStdout': False,
u'Cmd': [u'composer', u'install'],
u'Domainname': u'',
u'Entrypoint': None,
u'Env': [u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
u'LANG=en_US.UTF-8',
...
compose.cli.verbose_proxy.proxy_callable: docker disconnect_container_from_network <- (u'0df53c5ae127ae0b9cc5deeb34c54b028a0a464e7288e0119131624f66ba0a09', u'beregistration_sdnet')
compose.cli.verbose_proxy.proxy_callable: docker disconnect_container_from_network -> None
compose.cli.verbose_proxy.proxy_callable: docker connect_container_to_network <- (u'0df53c5ae127ae0b9cc5deeb34c54b028a0a464e7288e0119131624f66ba0a09', u'beregistration_sdnet', ipv4
_address=None, ipv6_address=None, links=[], aliases=[])
compose.cli.verbose_proxy.proxy_callable: docker connect_container_to_network -> None
compose.cli.verbose_proxy.proxy_callable: docker start <- (u'0df53c5ae127ae0b9cc5deeb34c54b028a0a464e7288e0119131624f66ba0a09')
compose.cli.verbose_proxy.proxy_callable: docker start -> None It seems that the command So, I tried to run |
I think it is how Docker reads commands, it splits into space-separated parts since between quotes it thinks that I start to guess it isn't a Docker related problem 🤔 Are you able to run |
Well, thank you for all these advices. It appears that I have The command But when I go to BUT: when I type The thing is : i can't manage to obtain the same going through |
Hm, got it. It seams that you got it working, but maybe you could try |
I'll try that indeed. But it seems to me that there might be a small bug in the docker-compose run command, in relation to mount functionality, because with docker run command, I could mount my volume at the right place which is the main issue that I encountered + set my working directory to The consequence of that is that i can't manage my services the way I wanted to, through the docker-compose.yml file. Thanks a lot @leocavalcante for your help, it helped me get this to work ! |
Np, glad to help 😄 |
i had the same issue but putting lower case and back slash solved it -v c:/wamp/www/mpesa:/home/src |
I ultimately resolved my initial problem. With I had to put: instead of: which doesn't work for Win 7. So, quick differences:
With these minor changes, it worked, at last..! |
I had to put: |
Problem: |
@johanchouquet thanks! Your solution saved me |
To resolve "Invalid volumes",For Toolbox. (docker-archive/toolbox#607)
From a Windows 10 host and Windows containers, the working volumes specification format that works for me: |
Dear stranger. If you end up here (as I did multiple times). There is another way of using Docker on Windows. |
I'm getting this error when I run
docker-composer up
:Here is what I have in my docker-compose.yml:
This works like charm in native Docker for Windows 10, but with Docker Toolbox on Windows 7 there is a problem. Is it a bug? Or what am I doing wrong?
The text was updated successfully, but these errors were encountered: