Windows volume mount issue

Hi,

This is the first time, I’m porting on the forum for help. This is my current setup:

Rancher Server (v1.6.8) on CentOS 7.3 with Windows Enviroment
Rancher Host on Windows 2016 Server with the following version:

PS C:\tmp> docker version
Client:
 Version:      17.06.1-ee-2
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   8e43158
 Built:        Wed Aug 23 21:16:53 2017
 OS/Arch:      windows/amd64

Server:
 Version:      17.06.1-ee-2
 API version:  1.30 (minimum version 1.24)
 Go version:   go1.8.3
 Git commit:   8e43158
 Built:        Wed Aug 23 21:25:53 2017
 OS/Arch:      windows/amd64
 Experimental: true

I’ve installed docker-compose on Windows 2016 (Rancher Host) and created a docker-compose.yml file:

PS C:\tmp> docker-compose version
docker-compose version 1.12.0, build ee0f34e1
docker-py version: 2.2.1
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.2j  26 Sep 2016

PS C:\tmp> docker-compose config
networks: {}
services:
  epa-web-backend:
    image: openjdk:8u131-jdk-nanoserver
    network_mode: nat
    stdin_open: true
    tty: true
    volumes:
    - C:\nas\epa:C:\nasepa\:rw
version: '2.1'
volumes: {}

If I do docker-compose up, I can see that the directory C:\nas\epa\ on my host is mounted on the container as C:\nasepa\. It is working well.

However, if I use this with rancher-compose or load the same docker-compose.yml into the catalog:

version: ‘2’
services:
epa-web-backend:
image: openjdk:8u131-jdk-nanoserver
labels:
io.rancher.scheduler.affinity:host_label_soft_ne: host_role=db
stdin_open: true
tty: true
network_mode: nat
volumes:
- C:\nas\epa:C:\nasepa:rw

** the version has to be ‘2’ because, rancher-compose doesn’t recognize ‘2.1’

If I ran rancher-compose up, I’ll see the error on Rancher Server UI:

epa-web-backend (Failed to allocate instance [container:1i163]: Bad instance [container:1i163] in state [stopping]: Error response from daemon: invalid volume spec “\nas\epa”: invalid volume specification: ‘\nas\epa’)

Things that I have tried:

  • use \\c\nas\epa:\\c\nasepa:rw
  • use just \\nas\epa:\\nasepa:rw
  • use / instead of \
  • removed the :rw at the back
  • setting the COMPOSE_CONVERT_WINDOWS_PATHS environment variable to 1 and 0 or removing it all together

All the above doesn’t seem to work. I hope someone has resolved this before.

Thanks in advance for any help!

I tried with below combinations. Still getting same error. - "invalid volume spec “/testdir”: invalid volume specification: ‘\testdir’ "

  - C:\testdir\:C:\testdir\  
  - C/testdir:C:\testdir\
  - C/testdir:C/testdir   
  - C/testdir/:C/testdir/  
  - \\C/testdir/:\\C/testdir/
  - \\C/testdir:\\C/testdir
  - \\C\testdir\:\\C\testdir\
  - //c/testdir
  - c:\testdir\:c:\testdir\
  - c:\\testdir:c:\\testdir 

I think this feature is not yet implemented on rancher.

Thanks,
Vishnu