[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.11:dockerBuild (default-cli) on project servone: 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]
Explained step to build a docker image actually fails.
Create microservice
Create gateway
Create docker folder and run 'jhipster docker-compose'
As instructed run 'mvnw package -Pprod jib:dockerBuild'
v5.5.0
λ jhipster info
Using JHipster version installed locally in current project's node_modules
Executing jhipster:info
Options: from-cli: true
Welcome to the JHipster Information Sub-Generator
[email protected] C:\dev\bitbucket\jhipster-retest\servone
`-- [email protected]
##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
{ "generator-jhipster": { "promptValues": { "packageName": "com.servone" }, "jhipsterVersion": "5.5.0", "applicationType": "microservice", "baseName": "servone", "packageName": "com.servone", "packageFolder": "com/servone", "serverPort": "8081", "authenticationType": "jwt", "cacheProvider": "hazelcast", "enableHibernateCache": false, "websocket": false, "databaseType": "mongodb", "devDatabaseType": "mongodb", "prodDatabaseType": "mongodb", "searchEngine": false, "messageBroker": false, "serviceDiscoveryType": "eureka", "buildTool": "maven", "enableSwaggerCodegen": false, "jwtSecretKey": "bXktc2VjcmV0LXRva2VuLXRvLWNoYW5nZS1pbi1wcm9kdWN0aW9uLWFuZC10by1rZWVwLWluLWEtc2VjdXJlLXBsYWNl", "enableTranslation": false, "testFrameworks": [], "jhiPrefix": "jhi", "clientPackageManager": "npm", "skipClient": true, "skipUserManagement": true } }
entityName.json
files generated in the .jhipster
directory
JDL entity definitions
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
git version 2.9.0.windows.1
node: v8.12.0
npm: 6.4.1
yeoman: 2.0.5
yarn: 1.10.1
Docker version 18.03.0-ce, build 0520e24302
docker-compose version 1.20.1, build 5d8c71b2
Congratulations, JHipster execution is complete!
entityName.json
files generated in the .jhipster
directoryAre you able to run docker commands manually without issues? also does your docker setup need sudo access? if so you may have to run the gradle commands also with sudo or add your user to docker group?
@saturnism any idea about this?
the error reads that docker command failed to run. jib:dockerBuild
builds w/ docker daemon.
if you change the name of the image to a repository coordinate, then jib:build
can build directly to the registry.
Yes you need to have the Docker daemon running, so I'm closing this, thanks @saturnism !
docker daemon is running. i'm using docker-machine . the same error i have on mac.
the error reads that docker command failed to run.
jib:dockerBuild
builds w/ docker daemon.
if you change the name of the image to a repository coordinate, thenjib:build
can build directly to the registry.
jib:build now returns:
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.11:build (default-cli) on project servone: Build image failed, perhaps you should set a credential helper name with the configuration '
Are you able to run docker commands manually without issues? also does your docker setup need sudo access? if so you may have to run the gradle commands also with sudo or add your user to docker group?
@saturnism any idea about this?
Yes, i'm running all docker, docker-machine, docker-compose commands successfully. Able to create images and run containers.
This issue appears only with jhipster generated code.
Maybe Windows related? docker load
outputs requested load from stdin, but stdin is empty
on Mac but doesn't throw an error.
I get a different message when I exit Docker and try jib:dockerBuild
, so I think the problem is different. Error message:
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.11:dockerBuild (default-cli) on project mono: Build to Docker daemon failed: 'docker load' command failed with error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?: Broken pipe -> [Help 1]
On a side note, when using just jib:build
, I've had to add the Docker user+password+image+tag to the command, then it works:
./mvnw verify -Pprod -DskipTests jib:build -Djib.to.auth.password="docker-password" -Djib.to.auth.username="docker-username" -Dimage=image-name:tag
Sorry, reading your comments I'm reopening the ticket, of course.
Maybe Windows related?
docker load
outputsrequested load from stdin, but stdin is empty
on Mac but doesn't throw an error.I get a different message when I exit Docker and try
jib:dockerBuild
, so I think the problem is different. Error message:
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.11:dockerBuild (default-cli) on project mono: Build to Docker daemon failed: 'docker load' command failed with error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?: Broken pipe -> [Help 1]
On a side note, when using just
jib:build
, I've had to add the Docker user+password+image+tag to the command, then it works:
./mvnw verify -Pprod -DskipTests jib:build -Djib.to.auth.password="docker-password" -Djib.to.auth.username="docker-username" -Dimage=image-name:tag
tried as stated, still having:
here my docker output for hello-world
docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
d1725b59e92d: Pull complete
Digest: sha256:0add3ace90ecb4adbf7777e9aacf18357296e799f81cabc9fde470971e499788
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
@bahadyr : can you try to generate a project under C:\Users\<username>
and test the build again ?
@bahadyr : can you try to generate a project under
C:\Users\<username>
and test the build again ?
@pascalgrimaud : Tried, and got the same error:
[INFO] Building war: C:\Users\bahadyr\test-jhipster\gw\target\gw-0.0.1-SNAPSHOT.war
[INFO]
[INFO] --- spring-boot-maven-plugin:2.0.5.RELEASE:repackage (default) @ gw ---
[INFO]
[INFO] --- jib-maven-plugin:0.9.11:dockerBuild (default-cli) @ gw ---
[WARNING] Setting image creation time to current time; your image may not be reproducible.
[INFO]
[INFO] Containerizing application to Docker daemon as gw...
[INFO]
[INFO] Getting base image openjdk:8-jre-alpine...
[INFO] Building extra files layer...
[INFO] Building dependencies layer...
[INFO] Building classes layer...
[INFO] Building resources layer...
[INFO] The base image requires auth. Trying again for openjdk:8-jre-alpine...
[INFO] Retrieving registry credentials for registry.hub.docker.com...
[INFO] Finalizing...
[INFO] Loading to Docker daemon...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:52 min
[INFO] Finished at: 2018-11-02T09:19:19+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.11:dockerBuild (default-cli) on project gw: 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]
I'm not sure how much we can help here since its not reproduceable. It
could be an issue from maven plugin or Jib, or it could be a proxy issue or
Jhipster config issue. Did you try to get help in the Jib project?
On Fri, 2 Nov 2018, 2:22 am BRBV <[email protected] wrote:
@bahadyr https://github.com/bahadyr : can you try to generate a project
under C:\Users\and test the build again ? Tried, and got the same error:
[INFO] Building war:
C:\Users\bahadyr\test-jhipster\gw\target\gw-0.0.1-SNAPSHOT.war [INFO]
[INFO] --- spring-boot-maven-plugin:2.0.5.RELEASE:repackage (default) @ gw
--- [INFO] [INFO] --- jib-maven-plugin:0.9.11:dockerBuild (default-cli) @
gw --- [WARNING] Setting image creation time to current time; your image
may not be reproducible. [INFO] [INFO] Containerizing application to Docker
daemon as gw... [INFO] [INFO] Getting base image openjdk:8-jre-alpine...
[INFO] Building extra files layer... [INFO] Building dependencies layer...
[INFO] Building classes layer... [INFO] Building resources layer... [INFO]
The base image requires auth. Trying again for openjdk:8-jre-alpine...
[INFO] Retrieving registry credentials for registry.hub.docker.com...[INFO] Finalizing... [INFO] Loading to Docker daemon... [INFO]
[INFO] BUILD FAILURE [INFO]
[INFO] Total time: 03:52 min [INFO] Finished at: 2018-11-02T09:19:19+08:00
[INFO]
[ERROR] Failed to execute goal
com.google.cloud.tools:jib-maven-plugin:0.9.11:dockerBuild (default-cli) on
project gw: 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]—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/8710#issuecomment-435240746,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDlFxyuvvSZYfNDttpXtBFoqJhkDhX4ks5uq546gaJpZM4YGuX1
.
@deepu105 it's easy to reproduce.
I got fresh windows and mac
installed jdk8, jhipster
created microservice, gateway
binded them witn 'jhipster docker-compose'
executed 'mvnw package -Pprod jib:dockerBuild' as from the output of jhipster
@deepu105 Just now independently tested on a NEW machine and got the same error.
[WARNING] Setting image creation time to current time; your image may not be reproducible.
[INFO]
[INFO] Containerizing application to Docker daemon as msone...
[INFO]
[INFO] Getting base image openjdk:8-jre-alpine...
[INFO] Building dependencies layer...
[INFO] Building extra files layer...
[INFO] Building classes layer...
[INFO] Building resources layer...
[INFO] The base image requires auth. Trying again for openjdk:8-jre-alpine...
[INFO] Retrieving registry credentials for registry.hub.docker.com...
[INFO] Finalizing...
[INFO] Loading to Docker daemon...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:10 min
[INFO] Finished at: 2018-11-02T17:57:09+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.11:dockerBuild (default-cli) on project msone: Build to Docker daemon failed: 'docker load' command failed with error: requested load from stdin, but stdin is empt
y: The pipe has been ended -> [Help 1]
[ERROR]
Is it failing only on windows or on mac as well, I'm on Linux and I
couldn't reproduce and most of the core team is on Mac and I'm sure they
don't see any issue as well. @jhipster/developers can someone try?
Thanks & Regards,
Deepu
On Fri, Nov 2, 2018 at 10:59 AM BRBV notifications@github.com wrote:
Just now independently tested on a new machine and got the same error.
[WARNING] Setting image creation time to current time; your image may not
be reproducible.
[INFO]
[INFO] Containerizing application to Docker daemon as msone...
[INFO]
[INFO] Getting base image openjdk:8-jre-alpine...
[INFO] Building dependencies layer...
[INFO] Building extra files layer...
[INFO] Building classes layer...
[INFO] Building resources layer...
[INFO] The base image requires auth. Trying again for
openjdk:8-jre-alpine...
[INFO] Retrieving registry credentials for registry.hub.docker.com...
[INFO] Finalizing...
[INFO] Loading to Docker daemon...[INFO]
[INFO] BUILD FAILURE
[INFO]
[INFO] Total time: 04:10 min
[INFO] Finished at: 2018-11-02T17:57:09+08:00[INFO]
[ERROR] Failed to execute goal
com.google.cloud.tools:jib-maven-plugin:0.9.11:dockerBuild (default-cli) on
project msone: Build to Docker daemon failed: 'docker load' command failed
with error: requested load from stdin, but stdin is empt
y: The pipe has been ended -> [Help 1]
[ERROR]—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/8710#issuecomment-435328559,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDlF_bPslOAaATyqMwIdCbcd8WXjjpLks5urBdxgaJpZM4YGuX1
.
@deepu105 failed on 2 win machines and mac. haven't tried on linux yet.
@bahadyr I think one problem might be that you use a proxy and jib unsuccessfully tries to log in to the registry (docker hub by default). Can you try to log in to the docker hub before (docker login, then input your docker hub credentials) ?
Can you try:
mvnw clean package -Pprod jib:exportDockerContext
Then
docker build -t myimage target/jib-docker-context
We have a similar problem with our proxy company that requests credentials.
A solution to test, if you have a maven to install and configured to pass your proxy (not the one install with jhipster)
mvn clean package -Pprod jib:dockerBuild
or add manually your proxy conf
mvn clean package -Pprod jib:dockerBuild -Dhttps.proxyHost=proxy -Dhttps.proxyPort=8080 -Dhttps.proxyUser=AAA -Dhttps.proxyPassword=BBB
I've a direct internet and i'm not using proxy and disabled firewall.
Can you try:
mvnw clean package -Pprod jib:exportDockerContext
Then
docker build -t myimage target/jib-docker-context
@PierreBesson
Followed your commands and could build images.
Maybe a new issue has to be raised for below use case:
Now able to start containers. Some of them stopped working even though i followed generator questions correctly.
🐳 Welcome to the JHipster Docker Compose Sub-Generator 🐳
Files will be generated in folder: C:\Users\bahadyr\jhipster-app-test\docker
√ Docker is installed
? Which type of application would you like to deploy? Microservice application
? Which type of gateway would you like to use? JHipster gateway based on Netflix Zuul
? Enter the root directory where your gateway(s) and microservices are located ../
2 applications found at C:\Users\bahadyr\jhipster-app-test\
? Which applications do you want to include in your configuration? gw, servone
? Which applications do you want to use with clustered databases (only available with MongoDB and Couchbase)?
( * ) gw
( * ) servone
docker-compose ps
Name Command State Ports
'----------------------------------------------------------------------------------------------------------
docker_gw-app_1 sh -c chmod +x /entrypoint ... Up 5701/udp, 0.0.0.0:8080->8080/tcp
docker_gw-mongodb_1 docker-entrypoint.sh mongod Up 27017/tcp
docker_jhipster-registry_1 /bin/sh -c java ${ ... Up 0.0.0.0:8761->8761/tcp
docker_servone-app_1 sh -c chmod +x /entrypoint ... Exit 1
docker_servone-mongodb-node_1 docker-entrypoint.sh mongo ... Up 27017/tcp
docker_servone-mongodb_1 docker-entrypoint.sh mongo ... Exit 2
servone-mongodb-config docker-entrypoint.sh mongo ... Up 27017/tcp
probably because your Docker machine doesn't have enough memory.
The more I read this ticket, the more I think all problems comes from your environment, as no one manage to reproduce the issue
I'm doing these everyday on linux(preparing demo for Devoxx) and so far no problems and most people on core team are doing this on macs as well. So I don't know what we can do here, it definitely sounds like an issue with your environment. I'm closing this as not reproduceable. If you manage to gather more info and can prove that it indeed is a JHipster related bug then please let us know and we will reopen this. I'm so sorry we couldn't be of any more help. Hope you understand
Just now tried on another machine. having the same error.
Probably this happens because i'm using docker-machine.
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.11:dockerBuild (default-cli) on project service-1: 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]
Big thanks to @PierreBesson. Only your solution worked.
Correction: containers buid this way fail and stop running.
I faced the exact same issue, it never happened with older jhipster before.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:15 min
[INFO] Finished at: 2018-11-19T17:33:30+07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.11:dockerBuild (default-cli) on project aaa:
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]
@namnvhue Did you follow our docs around this:
On Windows, due to [lack of named pipes](https://github.com/spotify/docker-client/issues/875), you may have to tune settings for Docker and turn on “Expose daemon on tcp://localhost:2375 without TLS”.
Yes, this happens only with newer versions of jhipster on both windows and mac machines, and i tried on few machines. All same bug. Last year i was using it without issues.
@PierreBesson btw, containers buid with your solution also fails due to auth keys.
@PierreBesson Thanks for your reply, I actually have that turned on already. It must be another issue I guess
@deepu105 try installing jhipster they way described on the website on a new windows or mac os. Create micoservice and try jhipster docker-compose. Follow instructions to create image. Fail is there. It is so simple to reproduce.
Having the same issue as well. I upgraded existing microservices to jhipster 5.7.0 from other versions all less than 5.5.0 and I was able to build a microservice using ./gradlew bootWar -Pprod jibDockerBuild
but running the same command on the gateway fails with the same error
Caused by: java.io.IOException: 'docker load' command failed with error: requested load from stdin, but stdin is empty
Have a look at https://github.com/GoogleContainerTools/jib/issues/1258
I think the problem comes from jib + Windows and the Docker version of your Docker machine
@bahadyr Got working by updating docker see `here from @pascalgrimaud's answer above.
@SteffanUA on Windows it worked when I use 'Docker Quick Terminal'. Thank you!
what worked for me:
baeldung jib link
macos docker-credential-helpers
Most helpful comment
Can you try:
mvnw clean package -Pprod jib:exportDockerContext
Then
docker build -t myimage target/jib-docker-context