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:
LionRanger
461

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.

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
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