Description of the issue:
jig:dockerBuild fails on Windows with error: requested load from stdin, but stdin is empty: The pipe has been ended
Expected behavior:
Run the image with local docker
Steps to reproduce:
execute mvn compile jib:dockerBuild
Environment:
Docker 18.06.1-ce,
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Java version: 10.0.2, vendor: Oracle Corporation,
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
jib-maven-plugin Configuration:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>0.10.0</version>
<configuration>
<to>
<auth>
<password>local</password>
<username>local</username>
</auth>
<image>kot.jresearch.org/gavka-api:${maven.build.timestamp}</image>
<tags>
<tag>latest</tag>
</tags>
</to>
<container>
<ports>
<port>8080</port>
</ports>
<environment>
<spring.profiles.active>nokafka</spring.profiles.active>
</environment>
</container>
</configuration>
</plugin>
Log output:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.941 s
[INFO] Finished at: 2018-11-19T07:47:48+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.10.0:dockerBuild (default-cli) on project org.jresearch.gavka.api.boot: Build to Docker daemon failed: 'docker load' command failed with error: requested load from stdin, but stdin is empty: The pipe has been ended -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.10.0:dockerBuild (default-cli) on project org.jresearch.gavka.api.boot: Build to Docker daemon failed
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Build to Docker daemon failed
at com.google.cloud.tools.jib.maven.BuildDockerMojo.execute (BuildDockerMojo.java:124)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.io.IOException: 'docker load' command failed with error: requested load from stdin, but stdin is empty
at com.google.cloud.tools.jib.docker.DockerClient.load (DockerClient.java:193)
at com.google.cloud.tools.jib.builder.steps.LoadDockerStep.afterPushBaseImageLayerFuturesFuture (LoadDockerStep.java:106)
at com.google.common.util.concurrent.CombinedFuture$CallableInterruptibleTask.runInterruptibly (CombinedFuture.java:181)
at com.google.common.util.concurrent.InterruptibleTask.run (InterruptibleTask.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1135)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
at java.lang.Thread.run (Thread.java:844)
Caused by: java.io.IOException: The pipe has been ended
at java.io.FileOutputStream.writeBytes (Native Method)
at java.io.FileOutputStream.write (FileOutputStream.java:355)
at java.io.BufferedOutputStream.flushBuffer (BufferedOutputStream.java:81)
at java.io.BufferedOutputStream.write (BufferedOutputStream.java:127)
at java.security.DigestOutputStream.write (DigestOutputStream.java:146)
at com.google.cloud.tools.jib.hash.CountingDigestOutputStream.write (CountingDigestOutputStream.java:83)
at org.apache.commons.compress.utils.CountingOutputStream.write (CountingOutputStream.java:48)
at org.apache.commons.compress.utils.FixedLengthBlockOutputStream$BufferAtATimeOutputChannel.write (FixedLengthBlockOutputStream.java:244)
at org.apache.commons.compress.utils.FixedLengthBlockOutputStream.writeBlock (FixedLengthBlockOutputStream.java:92)
at org.apache.commons.compress.utils.FixedLengthBlockOutputStream.maybeFlush (FixedLengthBlockOutputStream.java:86)
at org.apache.commons.compress.utils.FixedLengthBlockOutputStream.write (FixedLengthBlockOutputStream.java:122)
at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.write (TarArchiveOutputStream.java:454)
at java.security.DigestOutputStream.write (DigestOutputStream.java:146)
at com.google.cloud.tools.jib.hash.CountingDigestOutputStream.write (CountingDigestOutputStream.java:83)
at com.google.common.io.ByteStreams.copy (ByteStreams.java:110)
at com.google.cloud.tools.jib.blob.BlobDescriptor.fromPipe (BlobDescriptor.java:47)
at com.google.cloud.tools.jib.blob.FileBlob.writeTo (FileBlob.java:38)
at com.google.cloud.tools.jib.tar.TarStreamBuilder.writeEntriesAsTarArchive (TarStreamBuilder.java:51)
at com.google.cloud.tools.jib.blob.WriterBlob.writeTo (WriterBlob.java:36)
at com.google.cloud.tools.jib.docker.DockerClient.load (DockerClient.java:179)
at com.google.cloud.tools.jib.builder.steps.LoadDockerStep.afterPushBaseImageLayerFuturesFuture (LoadDockerStep.java:106)
at com.google.common.util.concurrent.CombinedFuture$CallableInterruptibleTask.runInterruptibly (CombinedFuture.java:181)
at com.google.common.util.concurrent.InterruptibleTask.run (InterruptibleTask.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1135)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
at java.lang.Thread.run (Thread.java:844)
Additional Information:
@foal what happens if you perform the build in two steps:
mvn jib:buildTardocker load < target/jib-image.tarIt works - output below
C:\Development\work\repo\JRS\open\gavka\api.boot>mvn compile jib:buildTar
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]
[INFO] ----------< org.jresearch.gavka:org.jresearch.gavka.api.boot >----------
[INFO] Building JRS kafka UI: Apache Kafka admin application - boot application 1.0.14-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from lnexus: http://localhost:8081/repository/public/org/jresearch/gavka/org.jresearch.gavka.backend/1.0.14-SNAPSHOT/maven-metadata.xml
Downloaded from lnexus: http://localhost:8081/repository/public/org/jresearch/gavka/org.jresearch.gavka.backend/1.0.14-SNAPSHOT/maven-metadata.xml (2.0 kB at 2.1 kB/s)
Downloading from lnexus: http://localhost:8081/repository/public/org/jresearch/gavka/org.jresearch.gavka.domain/1.0.14-SNAPSHOT/maven-metadata.xml
Downloaded from lnexus: http://localhost:8081/repository/public/org/jresearch/gavka/org.jresearch.gavka.domain/1.0.14-SNAPSHOT/maven-metadata.xml (2.0 kB at 5.4 kB/s)
Downloading from lnexus: http://localhost:8081/repository/public/org/jresearch/gavka/org.jresearch.gavka.rest.api/1.0.14-SNAPSHOT/maven-metadata.xml
Downloaded from lnexus: http://localhost:8081/repository/public/org/jresearch/gavka/org.jresearch.gavka.rest.api/1.0.14-SNAPSHOT/maven-metadata.xml (2.0 kB at 6.0 kB/s)
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-logging-dependecies) @ org.jresearch.gavka.api.boot ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ org.jresearch.gavka.api.boot ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- flatten-maven-plugin:1.0.1:flatten (flatten) @ org.jresearch.gavka.api.boot ---
[INFO] Generating flattened POM of project org.jresearch.gavka:org.jresearch.gavka.api.boot:jar:1.0.14-SNAPSHOT...
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ org.jresearch.gavka.api.boot ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- jib-maven-plugin:0.10.0:buildTar (default-cli) @ org.jresearch.gavka.api.boot ---
[INFO]
[INFO] Containerizing application to file at 'C:\Development\work\repo\JRS\open\gavka\api.boot\target\jib-image.tar'...
[WARNING] Base image 'gcr.io/distroless/java' does not use a specific image digest - build may not be reproducible
[INFO] Getting base image gcr.io/distroless/java...
[INFO] Building dependencies layer...
[INFO] Building classes layer...
[INFO] Building resources layer...
[INFO] Building snapshot dependencies layer...
[INFO] Finalizing...
[INFO]
[INFO] Container entrypoint set to [java, -cp, /app/resources:/app/classes:/app/libs/*, org.jresearch.gavka.web.GavkaApplication]
[INFO] Building image to tar file...
[INFO]
[INFO] Built image tarball at C:\Development\work\repo\JRS\open\gavka\api.boot\target\jib-image.tar
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.171 s
[INFO] Finished at: 2018-11-20T21:03:48+01:00
[INFO] ------------------------------------------------------------------------
C:\Development\work\repo\JRS\open\gavka\api.boot>docker load --input target/jib-image.tar
dbb3c0ba35ef: Loading layer [==================================================>] 2.076kB/2.076kB
a5b0ecac140a: Loading layer [==================================================>] 4.807kB/4.807kB
Loaded image: gavka/gavka-api:20181120-200337214
I'm curious. How do you run docker on Windows? Using Docker Toolbox, Docker for Windows, or docker-machine?
@foal I was able to do a jib:dockerBuild on my Windows box.
Could you try the following:
target/jib-image.tar instead of specifying the file on the command-line (docker load < target/jib-image.tar) ? That will more closely mimic the process following by jib:dockerBuild.examples/helloworld from Jib? I wonder if there's a size limit that's being hit.I wonder if there's a size limit that's being hit.
Hmm, I was able to build examples/spring-boot-kubernetes with no issue, which is a hefty 60MB.
@foal if these problems persist, please try rebooting your machine. Windows can be a strange beast.
FWIW, I used Docker for Windows 2.0.0.0-win78 (28905), which includes Docker Engine 18.09.0.
Pipe works, but anyway from yesterday I rebooted several times and update Docker to 2.0.0.0-win78 (28905). Now all works as desired.
Most helpful comment
Pipe works, but anyway from yesterday I rebooted several times and update Docker to 2.0.0.0-win78 (28905). Now all works as desired.