nf-tower icon indicating copy to clipboard operation
nf-tower copied to clipboard

Build failed: Task :tower-backend:jibDockerBuild

Open Qwarctick opened this issue 3 years ago • 0 comments

Hello,

I try to build nf-tower but I got an error with Docker and permission error:


> Task :tower-backend:jibDockerBuild

Containerizing application to Docker daemon as tower-backend...
Base image 'seqeralabs/nf-jdk:corretto-8u252' does not use a specific image digest - build may not be reproducible
The base image requires auth. Trying again for seqeralabs/nf-jdk:corretto-8u252...
Using base image with digest: sha256:6d7075dc841c2f8f6f3654e9e573cdda86c38a0f9f9dfcb745e8bbd7633f7714

Container entrypoint set to [/bin/sh]
Container program arguments set to [/tower.sh]
Executing tasks:
[==============================] 100.0% complete


> Task :tower-backend:jibDockerBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':tower-backend:jibDockerBuild'.
> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: 'docker load' command failed with error: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/load?quiet=1: dial unix /var/run/docker.sock: connect: permission denied


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5s
3 actionable tasks: 1 executed, 2 up-to-date

I don't understand why jib got a permission denied. I have access to the docker socket without problems:

 vagrant@nextflow-tower:~/nf-tower$ docker ps 
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
vagrant@nextflow-tower:~/nf-tower$ docker --host unix:///var/run/docker.sock ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
vagrant@nextflow-tower:~/nf-tower$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

I am asking: Why is the build done on the machine and not in a docker image?

Qwarctick avatar May 19 '21 10:05 Qwarctick