Download [#HAP-910] Docker build-info/push support on Windows slave

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
[HAP-910] Docker build-info/push support on Windows slave Created: 13/Apr/17
Updated:
14/Apr/17
Status:
Project:
Component/s:
Affects
Version/s:
Fix Version/s:
Open
Jenkins Artifactory Plug-in
None
2.10.3
Type:
Reporter:
Resolution:
Labels:
Environment:
Bug
High
Priority:
Stefan Lengauer
Eyal Ben Moshe
Assignee:
Unresolved
0
Votes:
build-info, docker, jenkins
Jenkins 2.46.1 CentOS 7 (master)
Windows Server 2016 with Cygwin 2.5.1 (slave)
Jenkins Artifactory Plugin 2.10.3
Docker 17.03
None
Description
We want to use a Jenkins Windows slave to build Windows containers and push them to our Artifactory.
The build works fine with cygwin but when using the Artifactory Jenkins Plugin to push the created images we g
javax.ws.rs.ProcessingException: Could not initialize class org.newsclub.net.unix.NativeUn
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:261)
at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:701)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:697)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.ja
at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:
at com.github.dockerjava.jaxrs.InspectImageCmdExec.execute(InspectImageCmdExec.jav
at com.github.dockerjava.jaxrs.InspectImageCmdExec.execute(InspectImageCmdExec.jav
at com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.
at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
at com.github.dockerjava.core.command.InspectImageCmdImpl.exec(InspectImageCmdImpl
at org.jfrog.hudson.pipeline.docker.utils.DockerUtils.getImageIdFromTag(DockerUtil
at org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils$6.call(DockerAgentUtils
at org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils$6.call(DockerAgentUtils
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:94)
at java.lang.Thread.run(Unknown Source)
at ......remote call to JNLP4-connect connection from --------windows-slave------at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
at hudson.remoting.Channel.call(Channel.java:830)
at org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils.getImageIdFromAgent(Doc
at org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils.registerImageOnAgents(D
at org.jfrog.hudson.pipeline.steps.DockerPushStep$Execution.run(DockerPushStep.jav
at org.jfrog.hudson.pipeline.steps.DockerPushStep$Execution.run(DockerPushStep.jav
at
org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(
at hudson.security.ACL.impersonate(ACL.java:260)
at
org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(Abs
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.newsclub.net.uni
at org.newsclub.net.unix.AFUNIXSocket.<init>(AFUNIXSocket.java:36)
at org.newsclub.net.unix.AFUNIXSocket.newInstance(AFUNIXSocket.java:54)
at com.github.dockerjava.jaxrs.ApacheUnixSocket.<init>(ApacheUnixSocket.java:51)
at com.github.dockerjava.jaxrs.UnixConnectionSocketFactory.createSocket(UnixConnec
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHt
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHtt
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.jav
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.jav
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.jav
at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.jav
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252)
at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:701)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:697)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.ja
at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:
at com.github.dockerjava.jaxrs.InspectImageCmdExec.execute(InspectImageCmdExec.jav
at com.github.dockerjava.jaxrs.InspectImageCmdExec.execute(InspectImageCmdExec.jav
at com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.
at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
at com.github.dockerjava.core.command.InspectImageCmdImpl.exec(InspectImageCmdImpl
at org.jfrog.hudson.pipeline.docker.utils.DockerUtils.getImageIdFromTag(DockerUtil
at org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils$6.call(DockerAgentUtils
at org.jfrog.hudson.pipeline.docker.utils.DockerAgentUtils$6.call(DockerAgentUtils
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at
at
at
at
at
at
at
hudson.remoting.Request$2.run(Request.java:336)
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.
java.util.concurrent.FutureTask.run(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
hudson.remoting.Engine$1$1.run(Engine.java:94)
java.lang.Thread.run(Unknown Source)
Obviously it is trying to create a unix socket which of course wont work on Windows.
Is there any workaround or option we can set to avoid this behavior?
The part of the Jenkinsfile causing the issue:
def rtDocker = Artifactory.docker credentialsId: '-----------------'
for(int i = 0; i < imgs.size(); i++){
dockerbuildInfo.append(rtDocker.push("${imgs[i]}", "${dockertargetrepo}"))
}
artifactory.publishBuildInfo(dockerbuildInfo)
This is working without problems on our Linux slaves
Comments
Comment by Roman Gurevitch [ 13/Apr/17 ]
@Stefan Lengauer, Jenkins Artifactory-Docker integration allows setting different docker hosts.
From the documentation:
def rtDocker = Artifactory.docker username: 'artifactory-username', password:
'artifactory-password', host: "tcp://<daemon IP>:<daemon port>"
For further information please refer to Docker Builds with Artifactory
And setting up Docker Engine on Windows
Comment by Stefan Lengauer [ 13/Apr/17 ]
Thanks for pointing me in the right direction. I was somehow missing the option to use tcp
instead of sockets. Nonetheless it would be nice to have an error message in the reported case
intead of the stacktrace but this is a minor improvement.
Currently I am getting "manifest invalid" Errros when trying to push the images, but this needs
some more investigation. I just wanted to give you a quick update.
Comment by Stefan Lengauer [ 14/Apr/17 ]
This can be closed. Using tcp fixes it.
The "manifest invalid" errors don't seem to be related to this issue. I currently think this might
be .
Thanks again for your help!
Generated at Fri May 12 02:52:15 UTC 2017 using JIRA 7.1.9#71013sha1:1aa0586d78efb7ed8b3de5c648d4b24912070b66.
Related documents