Closed vyshkov closed 7 years ago
The dockerServerUrl is used only for our functional tests and does not work for normal usage.
Native Windows named pipe support is currently not supported which is why I believe you're seeing the above issue but not when you connect to the tcp port. However, by default and on Windows the plugin should connect to that url by default. Which version of the plugin are you using?
@cdancy, ok it seems i we have very old plugin version. Its work fine after update. Thank you!
Hi, I have the same issue using 3.0.8:
java.lang.RuntimeException: Library 'junixsocket-native-2.0.4.dll' not found! at org.newsclub.net.unix.NarSystem.getLibPath(NarSystem.java:132) at org.newsclub.net.unix.NarSystem.loadLibrary(NarSystem.java:36) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
So I'm using Windows 10 and Docker for Window (hyper-v), is there anything special I need to do to my build script for this to work?
Thanks
Do you have a reproducible snippet we can look it? I suspect you're trying to connect to a Windows names pipe instead of the tcp port
Think you might be onto something..
task buildDocker(type: DockerBuildImage, dependsOn:["build", "copyJar", "createDockerfile"]) { if (System.env.DOCKER_HOST) { url = "$System.env.DOCKER_HOST".replace("tcp", "https") if (System.env.DOCKER_CERT_PATH) { certPath = new File(System.env.DOCKER_CERT_PATH) } } else { url = 'unix:///var/run/docker.sock' } print "Docker: Image filename = ${url}" inputDir = file('build/docker') tag = "${docker_url}/${docker_image_name}:${build_version}".toLowerCase() }
After uninstalling Docker Toolkit and installing Docker for Windows the environment variable DOCKER_HOST was removed.. So just need to obtain the right ip and port I guess?
If you install native docker on win-10, and expose the tcp port, docker should listen at http://127.0.0.1:2375
Yes if you select the option it is working :) Was just wondering why the TLS was enabled by default.. But more a question for Docker For Windows than the plugin.
@whgibbo yeah I honestly don't know. Don't use windows myself and the only involvement I typically have with it is helping folks such as yourself :)
Docker does listen through the port 2375. The plugin works fine when handling and deploying the docker machines. but it fails to work when i try to debug with the error on the deploy log:
"Cannot retrieve debug connection: java.net.MalformedURLException: unknown protocol: tcp"
Some people have solved this issue changing to port 2375 on dockers over linux or mac. But that's impossible using "Docker for windows" since it doesn't allow us to create machines and expose the port 2376 (secured).
Is it possible for the plugin to work through the not secured port 2375 for debugging?
@ricardoaat it should work no matter what you're doing. Do you have a reproducible snippet of your gradle file to look at? My hunch is that your URL is somehow off/wrong.
The thing is when the docker container is running (even started through the plugin) i'm able to debug remotely using itellij's remote "Run/Debug Configuration". But the docker plugin fails throwing that message.
The debug port configured at the Deployment tab is 5005
here's my dockerfile:
FROM tomcat
MAINTAINER Ric Arcila <ricardoarcila@outlook.com>
RUN apt-get update && apt-get -y upgrade
WORKDIR /usr/local/tomcat/bin
ENV JPDA_ADDRESS=5005
ENV JPDA_TRANSPORT=dt_socket
COPY build/libs/simple-rest-app.war /usr/local/tomcat/webapps/
EXPOSE 5005 8080
ENTRYPOINT ["catalina.sh", "jpda", "run"]
and my container_settings.json
{
"_comment": "FOR DETAILED FORMAT LOOK AT https://docs.docker.com/engine/api/v1.22/#create-a-container",
"AttachStdin": true,
"OpenStdin": true,
"HostConfig": {
"PortBindings":{ "8080/tcp": [{ "HostIp": "0.0.0.0", "HostPort": "18080" }],
"5050/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "5050"
}
]
}
}
}
If i run this, it builds the images an runs it: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES fd4740d49f48 9b1113d608f0 "catalina.sh jpda run" 17 seconds ago Up 15 seconds 0.0.0.0:5005->5005/tcp, 0.0.0.0:8080->8080/tcp debug_tomcat
but if i try to debug the app at the end i get:
Attaching to container 'debug_tomcat'... Starting container 'debug_tomcat' 'debug_tomcat Dockerfile: Dockerfile' has been deployed successfully. Cannot retrieve debug connection: java.net.MalformedURLException: unknown protocol: tcp
junixsocket 2.2 now supports Windows 10, please give it a try!
Hi. I have problems with building docker images on Windows 10.
If i run buildDocker task i get following error:
OR in other project
But if i add
to the gradle script - everything fine. Nevertheless i cannot commit that config, so i forced to do this changes every time i clone project or switch branch. Is there any way to make this docker configuration global ? Or define through command line ? I tried
gradle clean buildDocker -PdockerServerUrl=http://localhost:2375
, but id doesn't help.Thank you in advance.