-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 stack deploy do not undersand volumes in windows format #1403
Comments
Looks like this has the same root-cause as #1404. Does this work if you temporarily hardcode the windows path? (not using the ENV-var substitution?) |
Hi! |
I found a solution (the difference is that I am using "docker-app" plugin but if you implement the same solution in your "docker compose" file, I think that it works), you can see it here: https://github.com/mcadac/docker/blob/master/docker-app/gotemplate/README.md |
I'm still running into this problem. My swarm masters are all linux (CentOS) and they have no idea how to deploy to windows nodes if I provide a windows volume bind path like so:
It also did not work for me if I changed it to:
This is pretty discouraging :( |
The volumes must be defined the verbose form and it must be the type "bind" |
@mcadac Thanks -- just tried that and still no bueno:
What am I missing? |
@thaJeztah I saw your merge! Thank you! When can we expect this to get released would you think? |
This will likely go out in the August patch release for 18.09, and included in either 19.03.0 or the first patch release for 19.03 (19.03.1). You should be able to download nightly builds of the CLI from download.docker.com later today or tomorrow (not sure at what time "nightly" is built 😂) |
Note that the fix will only address the "long" syntax; https://docs.docker.com/compose/compose-file/#long-syntax-3 The shorthand syntax ( |
@thaJeztah I had another related question to this issue. Will your merge also resolve cross-platform service creation with npipe mount type?
Using docker 19.03, from a linux manager node, it seems to complain about the mount path: However, running that service create command from a windows manager, works like a charm. |
@thaJeztah when you get a chance! Looking for some info on the above. Thank you! -Drew |
@Drewster727 hm.. could it be that if you're running that from a Linux command-line, that the shell treats the
will be converted to
Trying the following (I don't have a Windows node, but just to test the escaping idea); docker service create --detach --name=test --mount "type=npipe,source=\\.\pipe\docker_engine,target=\\.\pipe\docker_engine" nginx:alpine Inspecting the service spec (output formatted with docker service inspect --format '{{ json .Spec.TaskTemplate.ContainerSpec.Mounts}}' test [
{
"Type": "npipe",
"Source": "\\.\\pipe\\docker_engine",
"Target": "\\.\\pipe\\docker_engine"
}
] Which confirms that both the Changing the command to use either escaping backslashes, or using single quotes make sure that the shell doesn't see the back-slashes as escape characters will prevent that; Creating the service and escaping the back-slashes ( docker service create --detach --name=test --mount "type=npipe,source=\\\\.\\pipe\\docker_engine,target=\\\\.\\pipe\\docker_engine" nginx:alpine
docker service inspect --format '{{ json .Spec.TaskTemplate.ContainerSpec.Mounts}}' test [
{
"Type": "npipe",
"Source": "\\\\.\\pipe\\docker_engine",
"Target": "\\\\.\\pipe\\docker_engine"
}
] Single quotes (probably a better solution as it would work both on Windows and Linux shells): docker service create --detach --name=test --mount 'type=npipe,source=\\.\pipe\docker_engine,target=\\.\pipe\docker_engine' nginx:alpine
docker service inspect --format '{{ json .Spec.TaskTemplate.ContainerSpec.Mounts}}' test [
{
"Type": "npipe",
"Source": "\\\\.\\pipe\\docker_engine",
"Target": "\\\\.\\pipe\\docker_engine"
}
] |
@thaJeztah I'm not sure why I didn't try the double slashes. I thought I had tried it, but that did the trick.
Hopefully this helps someone else in the same situation. |
haha, no worries! I also had to scratch my head a few times before I saw what's happening. The single quotes are probably a bit easier to use, and might work cross-platform (linux/windows) but haven't tried on a Windows machine |
@thaJeztah thanks again for the fix for this, 19.03.2 works like a charm! |
I tried long version, it looks still not working. I am using version 19.03.4, did I config something wrong?
|
Hey I am facing the same issue now days (docker version 19.03.5)
Not working! |
@bryht your case looks slightly different, and looks to be related to the Kubernetes conversion. @chris-crone any ideas on that one? @rong0312 the fix that was made only makes changes to the long-hand syntax, not the shorthand one; #1403 (comment)
|
It looks like that error is coming from Compose on Kubernetes: https://github.com/docker/compose-on-kubernetes/blob/master/internal/convert/volumes.go#L49 @silvin-lubecki or @aiordache can you PTAL? |
I can't find a proper way to volume my stack's service. This problem relates only to 'docker stack deploy', my volume works as normal docker-compose up |
docker
docker-compose
That help at all? |
Finally found out the correct syntax when using Docker Desktop to deploy a stack with the local kubernetes cluster:
as an example if you wanted to bind C:\Users\bla\bla to /home/bla/bla |
Running the latest "stable" channel version
…On Sat, May 16, 2020, 2:43 PM Sebastiaan van Stijn ***@***.***> wrote:
@justinkb <https://github.com/justinkb> what version of docker (and
docker desktop) are you running? IIRC, docker desktop performs some
conversion to convert windows paths to the correct (internal) path to use
for Docker Desktop (but not sure if that conversion is done when using
kubernetes) @djs55 <https://github.com/djs55> do you know?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1403 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABVHKHOAFJVOWCQQ2K4RHTRR2C6HANCNFSM4FYKBFKA>
.
|
I believe Docker Desktop uses an API proxy to try to hide some of these differences, but there was a regression in the latest 2.3.0.2 stable which we're attempting to fix. Perhaps try the experimental build mentioned here to see if it helps at all? |
Description
I am using Docker CE For Windows (Version 2.0.0.0-beta1-win75 (19925) and using docker stack deploy to deploy a workload against the local k8s cluster.
If I define a volume using "linux like" syntax it works OK:
But If I use windows syntax it fails:
Then I receive on error:
Note that if instead of
c:\tfs\...
I use something like\c\tfs\...
(linux-syntax with no colon but with windows backslashes) I receive another error:This is very unfortunate, because under windows, docker-compose changes the format of Linux paths to windows paths when using "docker-compose config". So, if I have a compose file with one volume:
The output of
docker-compose config
is (linux slashes are converted to backslashes):But this format is not supported by
docker stack deploy
. This prevents me to usedocker-compose config | docker stack deploy -c -
.Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: