-
Notifications
You must be signed in to change notification settings - Fork 573
Plugin fails when Docker for Mac is installed (OSX) #218
Comments
what happens to Docker for Mac when DOCKER_HOST is set? |
Hi That was a fast respons! When I set DOCKER HOST to localhost DOCKER_HOST=tcp://127.0.0.1:2375 When i set it with the name where Docker for Mac forwards the ports ThomasPro:~ thomas$ export DOCKER_HOST=tcp://docker.local:2375 But I can ping it homasPro:~ thomas$ ping docker.local I filed a ticket on Docker forums and the workaround is to set DOCKER_HOST to ThomasPro:~ thomas$ export DOCKER_HOST=unix:///private/var/tmp/docker.sock What value you should set on Windows? I have no clue… Docker for Mac doesn’t set DOCKER_HOST, nor should it so this is a temporary fix. I hope you can get it working without this Best regards /Thomas
|
The ticket can be found here I https://forums.docker.com/t/spotify-docker-maven-plugin-cant-connect-to-localhost-2375/9093 |
+1 on this issue. Failed to execute goal com.spotify:docker-maven-plugin:0.4.5:build (default-cli) on project identify: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? |
+1 too using plugin version 0.4.9, docker 1.10.3, virtualbox 5.0.20, maven 3.3.9, java 1.8.0_74 and os x 10.11.4. The "docker-machine ls" command report URL "tcp://172.16.1.107:2376" so I exported DOCKER_HOST accordingly.
The plugin configuration is plain vanilla
There's something else I can help with? |
Sounds like it may be related to #183 (comment) |
So far I tried to change And by the way, my docker installation isn't remote - we use 172.16.0.0/12 to the virtualized hosts here. I tested using the regular 192.168.99.100 docker-machine just for sanity check and the problem persists. For now the workaround I'm using is to put some shell commands into the build and release the project to the next phase and keep investigating this issue. |
Good news, at least for me;), Please, refer to this. Looking at my Hope this help you guys! |
Having the same issue, using docker for mac beta9 |
Having the same issue as well. docker plugin in version 0.4.9. com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.conn.HttpHostConnectException Connection refused. |
I was just testing the issue with the newest Docker Beta for Mac:
and setting: |
actually looks like if you just follow the docker-machine instruction |
well, tried to use the 0.4.9 plugin version and still doesn't work.I mean, now I got stucked in the copy.
and thats it. the processor usage hits 300% and nothing happens |
if you are running in the IDE, you need to manually set those env variable in the maven build configuration. |
I confirm the |
On Sat, May 7, 2016 at 12:35 PM, Julien Dubois [email protected]
I can also confirm that doesn't work :( |
yep as @krystiannowak said, adding |
@wwsong Your suggestion is correct when you are running Docker using Docker tool box in Mac, which create a VM and runs docker inside it. Docker-maven-plugin does not have the issue reported here. However, Docker has recently released a native app for Mac, which is an invitation only beta program. The problem reported here is for Docker for Mac beta only. |
any news on this? |
I can build an image using docker-maven-plugin 0.4.9 and Docker for Mac ( e.g.
@luizkowalski have you tried a newer version of DFM? |
@mattnworb I'm using DFM 1.11.1-beta11, and set this is Java on activity monitor hahaha. kicking chrome's ass on memory eating I don't know if it helps, but here are my specs Maven:
Java
|
@luizkowalski thanks for the additional info. Just to be clear, that java process in the Activity Monitor is maven? If so and it happens again, could you try to take a thread dump of the process and post it here? Could you also mention what the full |
btw I am also using Maven 3.3.9 but JDK 1.8.0_71. |
Ok, here it goes:
full command:
and running with
Again, stuck at |
I think the problem is using <dockerDirectory>/</dockerDirectory> The plugin does not interpret this field as relative to the current working directory. So the directory scanner is probably trying to list every file on your disk:
Did you see this behavior before using Docker for Mac? You may want |
@mattnworb worked like a charm! |
but for some reason I cannot push
I just did |
I am going to close this issue then as it seems like the plugin works okay with Docker for Mac as long as @luizkowalski can you create a new issue for your push problem? You may want to double-check that you are configuring the plugin correctly to push to your private registry. |
I think that closing this was a bit premature. I have followed this thread and was hoping that this could be solved without setting DOCKER_HOST. Why can't the plugin default to this when DOCKER_HOST is missing? I think it's a bad idea to add things that is unnecessary:-) Just my 20c |
Is |
unix:///var/run/docker.sock is probably not a safe default... But can it be one of the candidates? first or second alternative... It seems Docker for MAC wont be helpful at all and publishing the 2375 port on localhost (or will it eventually) |
spotify/docker-client#436 will default the DockerClient to using |
Confirming that below changes from @krystiannowak fixed my issue on OSX El Capitan, Version 1.12.1 (build: 12133). Thanks @krystiannowak, you da man!
|
@pjajara happy to hear that it works for you! |
when is use,there was no problem |
I've been trying to use the plugin, version 0.4.13, on Ubuntu with latest Docker (Docker version 17.03.1-ce, build c6d412e) with DOCKER_HOST set this way: export DOCKER_HOST=unix:///var/run/docker.sock and I get the following error: [ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.4.13:build (default-cli) on project config: Exception caught: Request error: POST unix://localhost:80/build?t=petra/config: 500: HTTP 500 Internal Server Error -> [Help 1] Any suggestions to resolve this?? |
@PatrickOsborne have you seen the note in the readme about this? |
@mattnworb The image name follows the rules, but I am seeing this in the log, perhaps you can make some sense of it: Apr 6 10:31:44 patrick-petra dockerd[973]: time="2017-04-06T10:31:44.811169831-06:00" level=error msg="Handler for POST /build returned error: Cannot locate specified Dockerfile: Dockerfile" Dockerfile is located in project root. plugin config:
</plugin |
because you have specified |
Thanks Matt! I changed docker directory to be maven build dir (target) and copied Dockerfile into that directory with resources plugin and everything is working now. Thanks for all the prompt help!! |
@mattnworb I have a quick question, when the plugin runs it creates a directory called docker in the build output dir (target) and then everything from target/ gets copies into it. Could you explain what is going on there? What is that for? Thanks, Patrick |
Hello; I'm having a similar issue. I am running Docker for Mac. There is no
Nevertheless, I can also see in my Maven debug output that it is not being honored:
There are no logs in my Docker daemon logs. How can I change that |
The root issue is spotify/docker-client#479: briefly, no matter what you set as the |
Thanks for your reply, @mattnworb. What's bizarre is that there are no daemon logs at all (from the timeframe we're talking about). So there's a 500, which implies someone is answering the phone :-D but I can't find any record anywhere of what the problem is. Docker information in case it matters:
|
Sorry, I see you asked "how" I checked the logs. I've done |
For posterity, and others on macOS: if you have a syntax error in your |
@luizkowalski Did you solve your problem of not beeing able to push ? |
@princyraza I don't remember...I think I moved to a CI instead pushing on my own |
@luizkowalski ok thanks. I am going to move mine to a CI too. However, I solved the push issue by adding my credentials in the global settings.xml |
Not working for me.
|
@alonsoir Docker does not allow image names with upper case characters, the daemon returns an error when you attempt to build an image with such a name which the plugin does not handle well. |
Description
The plugin fails to build the container when I'm using "Docker for Mac". The plugin can't connect to the Docker daemon. (I suspect that the absence of DOCKER_HOST env variable could be the reason. The problem is that Docker for Mac stops working if i set it...)
How to reproduce
Run a maven build after installing Docker for Mac
What do you expect
I would expect the plugin to succeed :-)
What happened instead
The plugin could not connect to the daemon.
Software:
Full backtrace
The text was updated successfully, but these errors were encountered: