title: How do I grant the paketo builder access permissions to the docker socket when building from a docker image?
body: <p>When using buildpacks to build my spring boot application on Fedora I get the following error during the execution of the <a href="https://docs.spring.io/spring-boot/docs/current/maven-plugin/reference/htmlsingle/#goals-build-image" rel="nofollow noreferrer">spring-boot-plugin:build-image</a> goal:</p>
  <pre><code>[INFO]     [creator]     ERROR: initializing analyzer: getting previous image: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get &quot;http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info&quot;: dial unix /var/run/docker.sock: connect: permission denied
  </code></pre>
  <p>After digging into the goal and buildpacks, I found the following command in the <a href="https://buildpacks.io/docs/tools/pack/" rel="nofollow noreferrer">buildpack.io docs</a> (by selecting &quot;Linux&quot; and &quot;Container&quot;):</p>
  <pre><code>docker run \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v $PWD:/workspace -w /workspace \
    buildpacksio/pack build &lt;my-image&gt; --builder &lt;builder-image&gt;
  </code></pre>
  <p>AFAICT this command should be equivalent to what happens inside of maven and it exhibits the same error.
  My previous assumption was that the use in the <code>buildpacksio/pack</code> image doesn't have the access permissions to my docker socket. (The socket had 660 permissions and root:docker owner).</p>
  <p>UPDATE: Even after updating to 666 permissions the issue still persists.</p>
  <p>I don't really want to allow anyone to interact with the docker socket so setting it to 666 seems unwise. Is this the only option or can I also add the user in the container to the docker group?</p>