Failure sending layers to docker daemon
See original GitHub issueEnvironment:
- *Jib version: 2.6.0
- *Build tool: Gradle 6.3
- *OS: Centos 8
- *Docker: 19.03.13
Description of the issue: We are building multiple images inside our pipeline job (Image: Centos 8). For that we are using the following command:
src/java/gradlew --gradle-user-home .gradle --info --stacktrace --build-cache --no-daemon --console=plain --parallel -p src/java jibDockerBuild -x test -Djib.console=plain
Today we transferred our last service building its image to jib The successfully build layers cannot be uploaded to the docker daemon. For all other services inside the job it is working.
Building dependencies layer...
Building project dependencies layer...
Building resources layer...
Building extra files layer...
Building classes layer...
Container program arguments set to [/bin/sh, -c, ./start.sh] (inherited from base image)
Loading to Docker daemon...
Out of 10 retries, one succeeded to upload to the docker daemon
Expected behavior: Layers can be uploaded to the docker daemon
jib-gradle-plugin
Configuration:
jib {
from.image = "docker://${dockerBaseImageFullPath}"
to.image = "${dockerTargetImage}"
container {
format = 'Docker'
entrypoint = 'INHERIT'
ports = ['8080']
user = 'root'
}
extraDirectories {
paths {
path {
from = file("${project.buildDir}/docker")
into '/opt/app/eldorado-root/'
}
}
}
}
Log output:
Caused by: com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: 'docker load' command failed with error: Error processing tar file(exit status 1): unexpected EOF
at com.google.cloud.tools.jib.plugins.common.JibBuildRunner.runBuild(JibBuildRunner.java:283)
at com.google.cloud.tools.jib.gradle.BuildDockerTask.buildDocker(BuildDockerTask.java:115)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
... 91 more
Caused by: java.io.IOException: 'docker load' command failed with error: Error processing tar file(exit status 1): unexpected EOF
at com.google.cloud.tools.jib.docker.DockerClient.load(DockerClient.java:211)
at com.google.cloud.tools.jib.builder.steps.LoadDockerStep.call(LoadDockerStep.java:74)
at com.google.cloud.tools.jib.builder.steps.StepsRunner.lambda$loadDocker$18(StepsRunner.java:618)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
Caused by: java.nio.file.NoSuchFileException: /root/.cache/google-cloud-tools-java/jib/local/8ec1e6e385638003696fd867d91b22c5a03265bafae6c66c37e2ff7bebd4b0f9/f5d031af01f137ae07fa71720fab94d16cc8a2a59868766002918b7c240f3967
at com.google.cloud.tools.jib.blob.FileBlob.writeTo(FileBlob.java:38)
at com.google.cloud.tools.jib.tar.TarStreamBuilder.writeAsTarArchiveTo(TarStreamBuilder.java:52)
at com.google.cloud.tools.jib.image.ImageTarball.dockerWriteTo(ImageTarball.java:149)
at com.google.cloud.tools.jib.image.ImageTarball.writeTo(ImageTarball.java:78)
at com.google.cloud.tools.jib.docker.DockerClient.load(DockerClient.java:197)
... 5 more
Suppressed: java.io.IOException: This archive contains unclosed entries.
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.finish(TarArchiveOutputStream.java:289)
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.close(TarArchiveOutputStream.java:307)
at com.google.cloud.tools.jib.tar.TarStreamBuilder.writeAsTarArchiveTo(TarStreamBuilder.java:55)
at com.google.cloud.tools.jib.image.ImageTarball.dockerWriteTo(ImageTarball.java:149)
at com.google.cloud.tools.jib.image.ImageTarball.writeTo(ImageTarball.java:78)
at com.google.cloud.tools.jib.docker.DockerClient.load(DockerClient.java:197)
at com.google.cloud.tools.jib.builder.steps.LoadDockerStep.call(LoadDockerStep.java:74)
at com.google.cloud.tools.jib.builder.steps.StepsRunner.lambda$loadDocker$18(StepsRunner.java:618)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Additional Information: Building the image locally without --paralell works fine. Layers can be uploaded to the docker daemon. The size of the image is 630 MB
Enough disk space inside the pipeline job was available
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Docker failed to register layer - Stack Overflow
I had to restart my computer, but after restarting and trying to run mysql container with the command docker run -d mysql I...
Read more >Docker image pull fails and makes docker daemon ...
I am facing a strange issue with the docker image pull command where the command fails with this error; [desai@brilp0017 ~]$ docker image ......
Read more >Overview | Docker Documentation
The tool runs a suite of checks and displays PASS or FAIL next to each check. If there are any failures, it highlights...
Read more >Docker security
Review of the Docker Daemon attack surface. ... They can ping each other, send/receive UDP packets, and establish TCP connections, but that can...
Read more >Best practices for writing Dockerfiles - Docker Documentation
The following example builds an image using a Dockerfile that is passed through stdin . No files are sent as build context to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@porqueoutai Jib 2.7.0 has been released with this fix!
@chanseokoh I’m totally with you. Actually the problematic layers are coming from the base-base Image, which we load from docker-hub. I will created an issue regarding their layers. Thanks for your support. Glad you could reproduce the Problem.