Your Environment
The environment is the Kubernetes environment where we have jenkins slave pod which is spun up at runtime when a build job runs, this slave has a plugin which used docker-java-shaded library to tag the docker image. The docker socket /var/run/docker.sock is mounted to the pod from host machine. When the jenkins plugin running the docker-java lib is used and when it tries to tag the image, it fails with following error:
org.newsclub.net.unix.AFUNIXSocketException: No such file or directory (socket: /run/docker.sock)
at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:481)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681)
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:444)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:437)
at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:343)
at com.github.dockerjava.jaxrs.AuthCmdExec.execute(AuthCmdExec.java:30)
at com.github.dockerjava.jaxrs.AuthCmdExec.execute(AuthCmdExec.java:17)
at com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:23)
at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
at com.github.dockerjava.core.command.AuthCmdImpl.exec(AuthCmdImpl.java:22)
at com.cj.adsystems.deployment.fargate.Deployer.setupDocker(Deployer.java:272)
at com.cj.adsystems.deployment.fargate.Deployer.deploy(Deployer.java:81)
at com.davidron.fargatedemo.Deploy.main(Deploy.java:16)
Caused by: org.newsclub.net.unix.AFUNIXSocketException: No such file or directory (socket: /run/docker.sock)
Can you please state any possible reasons for this error?
Your Environment
The environment is the Kubernetes environment where we have jenkins slave pod which is spun up at runtime when a build job runs, this slave has a plugin which used docker-java-shaded library to tag the docker image. The docker socket /var/run/docker.sock is mounted to the pod from host machine. When the jenkins plugin running the docker-java lib is used and when it tries to tag the image, it fails with following error:
org.newsclub.net.unix.AFUNIXSocketException: No such file or directory (socket: /run/docker.sock)
at org.glassfish.jersey.apache.connector.ApacheConnector.apply(ApacheConnector.java:481)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681)
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:444)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:437)
at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:343)
at com.github.dockerjava.jaxrs.AuthCmdExec.execute(AuthCmdExec.java:30)
at com.github.dockerjava.jaxrs.AuthCmdExec.execute(AuthCmdExec.java:17)
at com.github.dockerjava.jaxrs.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:23)
at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:35)
at com.github.dockerjava.core.command.AuthCmdImpl.exec(AuthCmdImpl.java:22)
at com.cj.adsystems.deployment.fargate.Deployer.setupDocker(Deployer.java:272)
at com.cj.adsystems.deployment.fargate.Deployer.deploy(Deployer.java:81)
at com.davidron.fargatedemo.Deploy.main(Deploy.java:16)
Caused by: org.newsclub.net.unix.AFUNIXSocketException: No such file or directory (socket: /run/docker.sock)
Can you please state any possible reasons for this error?