You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the --context support added in 1.26.0,
with docker-compose installed on Windows,
and a remote host context running Ubuntu,
when starting a service having a volume specified in docker-compose.yml,
then you get Cannot create container for service [...]: invalid volume specification,
unless you also set $env:COMPOSE_CONVERT_WINDOWS_PATHS = 1.
Context information (for bug reports)
Output of docker-compose version
> docker-compose.exe version
docker-compose version 1.26.0, build d4451659
docker-py version: 4.2.1
CPython version: 3.7.4
OpenSSL version: OpenSSL 1.1.1c 28 May 2019
Output of docker version
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:23:10 2020
OS/Arch: windows/amd64
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:29:16 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
Output of docker-compose config
(Make sure to add the relevant -f and other flags)
Add a docker context pointing to the Linux instance, such that docker context ls gives e.g:
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default * Current DOCKER_HOST based configuration npipe:////./pipe/docker_engine swarm
ubuntu ssh://dave@ubuntu
Run docker-compose --context ubuntu up core
Observed result
ERROR: for d5f9d1c87360_redacted_core_1 Cannot create container for service core: invalid volume specification: 'C:\Users\dave\Documents\GitHub\REDACTED\Core:/REDACTED/Core:rw'
Expected result
The core service starting up as it would have running docker-compose up core (i.e. without --context ubuntu)
Stacktrace / full error message
ERROR: for d5f9d1c87360_redacted_core_1 Cannot create container for service core: invalid volume specification: 'C:\Users\dave\Documents\GitHub\REDACTED\Core:/REDACTED/Core:rw'
I realized I am even more confused by this because, as I now understand it:
Volume mounts are relative to the host running Docker, not on the file system where docker-compose is being run.
It sounds like this confusion is kind of similar to #6697.
As I now understand it: compose doesn't support volumes where the source is on the machine which is running compose, as opposed to the machine which is running the Docker engine itself.
This bug (#7524) exists only because I failed to understand that, and thus when I thought I was specifying a volume source on my Windows machine (running compose), I was actually specifying a volume source on my Ubuntu machine, hence invalid volume specification.
Cautionary tale: I do suspect that when the --context option is more generally available it might prompt people to try it, and then run in to more confusion discovering that the volumes are on the host, and not on the machine running compose.
I think that is evidenced by the long running existence of #2957.
Description of the issue
Using the
--context
support added in 1.26.0,with
docker-compose
installed on Windows,and a remote host context running Ubuntu,
when starting a service having a volume specified in
docker-compose.yml
,then you get
Cannot create container for service [...]: invalid volume specification
,unless you also set
$env:COMPOSE_CONVERT_WINDOWS_PATHS = 1
.Context information (for bug reports)
Output of
docker-compose version
Output of
docker version
Output of
docker-compose config
(Make sure to add the relevant
-f
and other flags)Steps to reproduce the issue
Be running
docker-compose
1.26.0 on Windows 10Be running Docker on Ubuntu 18.04.4 LTS
Add a
docker context
pointing to the Linux instance, such thatdocker context ls
gives e.g:Run
docker-compose --context ubuntu up core
Observed result
Expected result
The
core
service starting up as it would have runningdocker-compose up core
(i.e. without--context ubuntu
)Stacktrace / full error message
Additional information
docker-compose
1.26.0 on Windows 10Docker on Ubuntu 18.04.4 LTS
I manually got
docker-compose-Windows-x86_64.exe
from https://github.com/docker/compose/releases/tag/1.26.0, since it hasn't been bundled in to Docker Desktop for Windows yet.I can work around this issue by setting
$env:COMPOSE_CONVERT_WINDOWS_PATHS = 1
prior to runningdocker-compose --context ubuntu up core
.The text was updated successfully, but these errors were encountered: