Skip to content
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

Allow mapping of Windows named pipe into Windows container #5181

Closed
StefanScherer opened this issue Sep 8, 2017 · 10 comments
Closed

Allow mapping of Windows named pipe into Windows container #5181

StefanScherer opened this issue Sep 8, 2017 · 10 comments

Comments

@StefanScherer
Copy link
Member

After moby/moby#33852 is merged and available in 17.09.0-ce-rc1 I checked this with current Windows Server Insider 16278.

For the docker cli the syntax looks like the following line to map the Windows named pipe of the Docker engine into the Windows container.

docker run -u ContainerAdministrator -v \\.\pipe\docker_engine:\\.\pipe\docker_engine stefanscherer/docker-cli-windows:insider version

So I tried it with this docker-compose.yml

version: '2.1'
services:
  traefik:
    image: stefanscherer/traefik-windows:windowsservercore-insider
    command: --docker.endpoint=\\.\pipe\docker_engine --logLevel=DEBUG
    ports:
      - "8080:8080"
      - "443:443"
    volumes:
      - C:/traefik:C:/etc/traefik
      - \\.\pipe\docker_engine:\\.\pipe\docker_engine

but I get this error message

ERROR: for e638c5f802d5_e638c5f802d5_e638c5f802d5_traefik_traefik_1  Cannot create container for service traefik: invalid volume spec "\\\\.\\pipe\\docker_engine": file '\\.\pipe\docker_engine' cannot be mapped. Only directories can be mapped on this platform

ERROR: for traefik  Cannot create container for service traefik: invalid volume spec "\\\\.\\pipe\\docker_engine": file '\\.\pipe\docker_engine' cannot be mapped. Only directories can be mapped on this platform

I'm running these versions:

PS C:\Users\stefan\code\dockerfiles-windows\traefik> docker-compose version
docker-compose version 1.16.1, build 6d1ac219
docker-py version: 2.5.1
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.2j  26 Sep 2016
PS C:\Users\stefan\code\dockerfiles-windows\traefik> docker version
Client:
 Version:      17.09.0-ce-rc1
 API version:  1.31
 Go version:   go1.8.3
 Git commit:   ae21824
 Built:        Wed Sep  6 22:25:14 2017
 OS/Arch:      windows/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
@shin-
Copy link

shin- commented Sep 22, 2017

Thanks, I'll take a look. This probably needs some special-casing to make it happen.

@dnephin
Copy link

dnephin commented Sep 26, 2017

related PR from docker-cli: docker/cli#560

@shin-
Copy link

shin- commented Oct 24, 2017

Dependency on docker/docker-py#1780

@azstate
Copy link

azstate commented Feb 20, 2018

After adding docker support in VS2017 project, it gives an error "/c/ContainerAPI/FileUploader_/FileUploader/FileUploader:C:\app:rw": invalid volume specification: '\c\ContainerAPI\FileUploader_\FileUploader\FileUploader:C:\app:rw'

What is the reason behind this?

@Vacant0mens
Copy link

Was this feature released or abandoned? If it has been released, what version is it included in?

@dazinator
Copy link

Still experiencing this issue in docker ee latest stable, and latest docker-compose release from github.

 volumes:          
        - \\.\pipe\docker_engine:\\.\pipe\docker_engine

Cannot create container for service portainer: Unrecognised volume spec: file
'\.\pipe\docker_engine' cannot be mapped. Only directories can be mapped on this platform
ERROR: for portainer Cannot create container for service portainer: Unrecognised volume spec: file
'\.\pipe\docker_engine' cannot be mapped. Only directories can be mapped on this platform
Encountered errors while bringing up the project.

@shin-
Copy link

shin- commented Sep 7, 2018

@dazinator You'll need to use the long syntax, like so:

volumes:
  - source: '\\.\pipe\docker_engine'
    target: '\\.\pipe\docker_engine'
    type: npipe

@dazinator
Copy link

@shin- thank you!

@alexfpoole
Copy link

Just to say that there seems to be a problem with npipe Volumes in Windows which is fixed in docker-compose 1,23

Unfortunately docker-for-windows (at time of writing, Dec 4th '18,) still comes with docker-compose 1.22

The solution is to install it separately (choco install docker-compose) and rename C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe to something else, to force the machine to use the newer exe you just installed:

C:>docker-compose -v
docker-compose version 1.23.2, build 1110ad0

HTH someone - took me a while to figure it all out.

@andreaslink-de
Copy link

@dazinator You'll need to use the long syntax, like so:

volumes:
  - source: '\\.\pipe\docker_engine'
    target: '\\.\pipe\docker_engine'
    type: npipe

Thank you so much, this is the overall solution fixing it - even today. We are so used to the abbreviated form that this was not even considered before! Also a huge learning that the abbreviated one-row-form does not handle any syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants