Languages
[Edit]
EN

Docker + maven build problem - unix://localhost:80: Permission denied - com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException: Permission denied

2 points
Created by:
Kate_C
23510

Problem

I try to build my microservice (java + docker) from jenkins level.
I setup the build and got an exception (console output from jenkins level):

Dec 2, 2020 9:09:39 AM com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: Permission denied

org.apache.maven.plugin.MojoExecutionException: Could not build image
	at com.spotify.plugin.dockerfile.BuildMojo.buildImage(BuildMojo.java:208)
	at com.spotify.plugin.dockerfile.BuildMojo.execute(BuildMojo.java:110)
	
Caused by: com.spotify.docker.client.exceptions.DockerException: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException: Permission denied

Solution

Run below command from root:

chmod 666 /var/run/docker.sock

It will allow jenkins and other users to have permission to Docker socket file.

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join