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

Support windows named pipe #875

Closed
philippe-granet opened this Issue Aug 26, 2017 · 7 comments

Comments

Projects
None yet
6 participants
@philippe-granet
Copy link

philippe-granet commented Aug 26, 2017

Feature request

Support Windows named pipe like this :

final DockerClient docker = new DefaultDockerClient("npipe:////./pipe/docker_engine");

Example in fabric8io docker maven plugin :
https://github.com/fabric8io/docker-maven-plugin/blob/master/src/main/java/io/fabric8/maven/docker/access/DockerConnectionDetector.java#L123

Extract from Docker for Windows Faq

How do I connect to the remote Docker Engine API?
You might need to provide the location of the Engine API for Docker clients and development tools.

On Docker for Windows, clients can connect to the Docker Engine through a named pipe: npipe:////./pipe/docker_engine, or TCP socket at this URL: tcp://localhost:2375.

This sets DOCKER_HOST and DOCKER_CERT_PATH environment variables to the given values (for the named pipe or TCP socket, whichever you use).
@mattnworb

This comment has been minimized.

Copy link
Member

mattnworb commented Aug 28, 2017

Thanks for providing a link on how the named pipe can be accessed as a File, that is useful to know 👍

@davidxia

This comment has been minimized.

Copy link
Member

davidxia commented Nov 13, 2017

So would things just work if DefaultDockerClient just stripped "npipe:////./pipe/docker_engine" down to "//./pipe/docker_engine" and treated that as a file and talked to it like https://stackoverflow.com/a/2605884/553994. Hm might be a fair amount of work now that I look at how we talk to Unix sockets.

@hazsetata

This comment has been minimized.

Copy link

hazsetata commented Dec 14, 2017

I wanted to give this a try, here is what I was able to do so far: hazsetata@446ef75

It uses a RandomAccessFile and wraps it in a Socket (supporting only the bare minimal things that are needed to make this work). I then created a SocketFactory very similar to the Unix socket implementation's and modified DockerHost / DefaultDockerClient to support it.

It compiles, runs but some of the tests hang. I'm not sure yet what causes that, one possibility that I'll have to check is that because the code uses a file, the read() methods do not timeout (with a real Socket they would). If supporting that is a requirement, I'm not sure yet how to proceed.

Any comments / ideas would be very welcome!

@stale

This comment has been minimized.

Copy link

stale bot commented Sep 24, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 24, 2018

@stale stale bot closed this Oct 1, 2018

@php-coder

This comment has been minimized.

Copy link

php-coder commented Oct 9, 2018

As far I understand, this issue still hasn't been fixed. Could someone reopen it, then?

@davidxia davidxia reopened this Oct 9, 2018

@stale stale bot removed the stale label Oct 9, 2018

@davidxia davidxia added the pinned label Oct 9, 2018

@jan-zajic

This comment has been minimized.

Copy link
Contributor

jan-zajic commented Nov 20, 2018

Hi, i'm author of npipe implementation in fabric8io/docker-maven-plugin that you mentioned, see fabric8io/docker-maven-plugin@8112cdf#diff-1fec0d18db7198d4e068ea33ca319dca. I'll rewrite it for this project, PR coming soon ...

jan-zajic added a commit to jan-zajic/docker-client that referenced this issue Nov 20, 2018

Fix spotify#875
Signed-off-by: jzajic <jan.zajic@corpus.cz>
@jan-zajic

This comment has been minimized.

Copy link
Contributor

jan-zajic commented Nov 20, 2018

Implemented in PR #1114, works just fine on my Win 10 machine.

jan-zajic added a commit to jan-zajic/docker-client that referenced this issue Nov 20, 2018

Fix spotify#875
Signed-off-by: jzajic <jan.zajic@corpus.cz>

jan-zajic added a commit to jan-zajic/docker-client that referenced this issue Nov 27, 2018

jan-zajic added a commit to jan-zajic/docker-client that referenced this issue Nov 27, 2018

@davidxia davidxia closed this in 1d11fb4 Nov 27, 2018

davidxia added a commit that referenced this issue Nov 27, 2018

Merge pull request #1114 from jan-zajic/feature/npipe
Fix Issue #875 - windows named pipes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment