-
Notifications
You must be signed in to change notification settings - Fork 645
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
Add support for "Docker for Windows" #532
Conversation
I disable pooling for this type of connection, because i don't known if it's safe and i have some problems with it. |
Thanks a lot ! w.r.t to pooling, we indeed have some issues with the Unix socket. Could be that they are resolved, too, when pooling is disabled. But it could also be that there are concurrency issues, not so sure ( #259 has more info about this). I hope I can review and integrate your PR this week, but not sure, because right before PTO are are quite busy times ;-) |
@@ -54,7 +68,7 @@ | |||
public static final String CONTEXT_KEY_PREVIOUSLY_PULLED = "CONTEXT_KEY_PREVIOUSLY_PULLED"; | |||
|
|||
// Minimal API version, independent of any feature used | |||
public static final String API_VERSION = "1.18"; | |||
public static final String API_VERSION = "v1.18"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its correct without "v" because the "v" is added later to the version -->
docker-maven-plugin/src/main/java/io/fabric8/maven/docker/AbstractDockerMojo.java
Line 292 in e027a8a
access = new DockerAccessWithHcClient("v" + version, dockerUrl, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i see it now, i modify my test integration instead
Good point, I probably should do this for the Unix client as well. Might solve some of the issue we have with that (like in #259) |
Sorry, I didn't fully get this. If you don't configure a docker-machine (either in the plugin configuration or with properties), then docker machine will not be run at all. So, if you use a socket / pipe / TCP connection and leave out this configuration you should be save. I suggest that instead of introducing a new property here, simply don't add a docker-machine configuration in your use case (or work with profiles if you need to switch it on temporarily). |
LGTM, I will include it in the over-next version (need to make a release today). Thanks a lot, its really a very useful contribution. Beside the minor points above which we should discuss, could you please:
Thanks ! |
|
||
@Override | ||
public void connect(SocketAddress endpoint, int timeout) throws IOException { | ||
if (endpoint == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think we need a nullpointer check here. First my IDE says it never can be null (don't know how it know this ;-) but more important it will throw a NPE 10 lines later anyway (if so)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK i removed it.
@rhuss about docker.machine.ignoreEmpty - i think that docker-machine is called at startup in DockerConnectionDetector, but now i can see that only if docker.machine.name is configured? I removed this stuff and test at my site as soon as possible. |
…commit Signed-off-by: Jan Zajíc <jan.zajic@corpus.cz>
OK, i do fixes based on your comments and squashed and signed commit. |
cool, thanks a lot ! |
Does this include support for the Setting This may require a new issue if this plugin does not support |
Tbh, I'm not a Windows user and even need some extra setup for testing this. This PR does not include support for the Windows Credential Manager API. Of course we could add one, however for this we would need to find a Java API for this. If you have any pointer or idea how to access the credential manager, this would be very helpful. I guess the credential manager is not only used for pull authentication but also for push, or ? |
I have windows 10 and "docker for windows" installed... have you got any snapshot to try it? |
@rhuss Not really a windows user either, but got people developing on Windows where I work and using this plugin for several of our projects, however, credential helpers seems to be another one of the ways Docker is looking to modularize its implementation. In the |
@arielcarrera you can clone my branch, git clone https://github.com/jan-zajic/docker-maven-plugin.git, go into that cloned directory (cd docker-maven-plugin), build it: mvn install. Than you can use it in your pom with version 0.15-SNAPSHOT. |
Thanks a lot, I will cut a release soon with this changes. w.r.t to autentication, we wil continue on #534 . However, normally you should be abel to use at least means for authentication as described in https://dmp.fabric8.io/#authentication |
@jan-zajic I merged this PR to branch However when I run @jan-zajic could you (or some of your coworkers) try this, too, by checking out branch |
Another good test is https://github.com/rhuss/docker-maven-sample (where the pom.xml needs to be updated to the proper d-m-p snapshot version). |
I found out, that when waiting on a condition in the logoutput as it happens for the docker-maven-sample, then the main thread block on All in all I have the impression, its not very stable and probably cant released in this state. Maybe one can have a look how other Java Docker access libraries like https://github.com/docker-java/docker-java support Docker for Windows ? I really would love to include this in d-m-p. Said that, I'm soon off for holidays the next three weeks, and wont be able to continue here in the meantime. |
Hi Roland, I suspect that this problem occurs only with authentication {
"auths": {
"my.server": {
"auth": "dXN1YXJpbzpwYXNzd29yZA=="
}
}
} I know it can be less secure but I am trying with this configuration, maybe |
It could be a temporary workaround. 2016-08-11 12:19 GMT-03:00 Ariel Carrera carreraariel@gmail.com:
Tatú |
@arielcarrera I dont think its related to authentication as I can successfully build images ( It pretty sure a threading and locking thing. |
Ok Roland, don't worry I am working with version 0.15.2... after install 2016-08-11 13:24 GMT-03:00 Roland Huß notifications@github.com:
Tatú |
This PR adds support for new Docker for Windows on Windows 10 (not docker toolbox, see https://docs.docker.com/engine/installation/windows/). This version of docker exposes api through windows named pipe //./pipe/docker_engine. Currently yours maven plugin don't support this condition.
I added support for it, it's work at my machine, but you must set new configuration property "docker.machine.ignoreEmpty" to true, because windows docker don't expose any docker machine after installation.