Skip to content

docker stack deploy prepends current Unix dir to Windows bind mount source #34810

@StefanScherer

Description

@StefanScherer

Description

I tried to deploy a stack from a Mac/Linux client to a Windows swarm with a bind mount source from that Windows host.

Steps to reproduce the issue:
On the Windows swarm manager

  1. stop-service docker
  2. mkdir C:\data
  3. dockerd -D
    On the Mac/Linux client
  4. vi bind.yml
version: "3.2"
services:

  whoami:
    image: stefanscherer/whoami
    networks:
      - demo
    environment:
      - PORT=8000
    volumes:
      - type: bind
        source: C:/data
        target: C:/inside
    deploy:
      endpoint_mode: dnsrr
      placement:
        constraints:
          - node.platform.os == windows

networks:
  demo:
    driver: overlay
  1. docker stack deploy -c bind.yml bind

Describe the results you received:

Debug output of dockerd showed me the problem. The bind mount source is a mixture of my Mac's current directory (/Users/stefan/code/dockerfiles-windows/stack) and the Windows path given in the stack yml (C:/data) -> "/Users/stefan/code/dockerfiles-windows/stack/C:/data"

ERRO[2017-09-11T13:55:06.501786000-07:00] controller resolution failed                  error="invalid bind mount source, must be an absolute path: /Users/stefan/code/dockerfiles-windows/stack/C:/data" module="node/agent" node.id=tgqolab1d80v0wox5cg5hvg5d service.id=f7vqsvl8a93bkaoijjgtw7xk0 task.id=o5q1z8o968zecwfzzd7wmu2xc
ERRO[2017-09-11T13:55:06.502871300-07:00] failed to start taskManager                   error="invalid bind mount source, must be an absolute path: /Users/stefan/code/dockerfiles-windows/stack/C:/data" module="node/agent" node.id=tgqolab1d80v0wox5cg5hvg5d

Describe the results you expected:

The client shouldn't prepend its Unix current dir as it is an absolute Windows path given.

Additional information you deem important (e.g. issue happens only occasionally):

Deploying the stack from a Windows host (in my case I tested it directly on the single node Windows swarm manager) it works.

Output of docker version:

$ docker version
Client:
 Version:      17.06.2-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   cec0b72
 Built:        Tue Sep  5 20:12:06 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.09.0-ce-rc1
 API version:  1.32 (minimum version 1.24)
 Go version:   go1.8.3
 Git commit:   ae21824
 Built:        Wed Sep  6 22:35:40 2017
 OS/Arch:      windows/amd64
 Experimental: true

Output of docker info:

$ docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 8
Server Version: 17.09.0-ce-rc1
Storage Driver: windowsfilter
 Windows: 
Logging Driver: json-file
Plugins: 
 Volume: local
 Network: ics l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: active
 NodeID: tgqolab1d80v0wox5cg5hvg5d
 Is Manager: true
 ClusterID: ydmepvdy2pdai7japhc9qwerk
 Managers: 1
 Nodes: 1
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 3
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Root Rotation In Progress: false
 Node Address: 192.168.0.10
 Manager Addresses:
  192.168.0.10:2377
Default Isolation: process
Kernel Version: 10.0 16278 (16278.1000.amd64fre.rs3_release.170825-1441)
Operating System: Windows Server Datacenter
OSType: windows
Architecture: x86_64
CPUs: 2
Total Memory: 2GiB
Name: vagrant-2016
ID: KR2B:OLB5:E6SR:FNWK:JCGN:QTBC:7Q4B:4Y43:2DIA:FQKE:RIFG:V3TA
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: -1
 Goroutines: 136
 System Time: 2017-09-11T13:58:03.1914378-07:00
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions