What is happening when docker-maven plugin tries to build image?
<p>I am running Jenkins in a docker container and Jenkins tries to run my maven build. As part of the build, the docker maven plugin instructs it to build a docker image. </p>

<p>That part of the POM is below.</p>

<pre><code>&lt;plugin&gt;
    &lt;groupId&gt;com.spotify&lt;/groupId&gt;
    &lt;artifactId&gt;docker-maven-plugin&lt;/artifactId&gt;
    &lt;version&gt;0.3.8&lt;/version&gt;
    &lt;configuration&gt;
        &lt;imageName&gt;example&lt;/imageName&gt;
        &lt;baseImage&gt;java:latest&lt;/baseImage&gt;
        &lt;skipDockerBuild&gt;false&lt;/skipDockerBuild&gt;
        &lt;cmd&gt;["java", "-jar", "myLogThread-jar-with-dependencies.jar"]&lt;/cmd&gt;
        &lt;resources&gt;
            &lt;resource&gt;
                &lt;directory&gt;target/&lt;/directory&gt;
                &lt;include&gt;config.properties&lt;/include&gt;
            &lt;/resource&gt;
            &lt;resource&gt;
                &lt;directory&gt;${project.build.directory}&lt;/directory&gt;
                &lt;include&gt;myLogThread-jar-with-dependencies.jar&lt;/include&gt;
            &lt;/resource&gt;
        &lt;/resources&gt;
    &lt;/configuration&gt;
&lt;/plugin&gt;
</code></pre>

<p>The maven build runs until it attempts to build the image, at which point the following error message is spat out: </p>

<pre><code>[INFO] Building image example
[INFO] I/O exception (java.io.IOException) caught when processing request to {}-&gt;unix://localhost:80: Permission denied
</code></pre>

<p>I can go into the correct directory and the Dockerfile is there. </p>

<p>I can also run <code>sudo docker build .</code> and it will build the image with no issues. </p>

<p>Why is the maven build failing? What request is being made to localhost:80? How can I correct this so that maven can build my image?</p>

<p>Note: I have mounted the docker socket and binary in this container</p>