-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building docker image of spring boot #2207
Comments
Hi @nithinkota, Are you really a maintainer of the offcial repo |
I am new to docker.I started learning.This is my first project with spring boot docker. |
Can you build your APP and package your container locally, least push the image without JIB to this registry, using docker? I think the problem here isn't JIB. I think @chanseokoh say that you are try to use an official repo only to test your lab, so, it's strange. Se that, for example: If i need do the same thing that you, I'll create a repo like this:
|
Yeah, @raizoor is right. You should probably say something like |
@raizoor I am able to push the image without jib.While push the image with jib getting exception. |
I changed bit code in build.gradle as
Now when I give
|
On Google, don't you need to use the registry name on container image name too? My example (i'm not use google): |
I already logged in to dockerhub through command prompt using docker login. I tried with the following approches jib { I tried all the above approaches.Still getting same Error.I didn't understand where I am doing wrong. |
|
Before docker login config.json:
After docker login config.json:
When I logged in through command prompt using |
Can you add
|
And which version of Jib are you using? Recent versions should say
but looks like your build just returns
|
@chanseokoh |
Using Jib 1.8.0, can you upload the Gradle build log when running with the |
gradle jibDockerBuild don't send your image to registry. It's like you builds locally. |
@chanseokoh @raizoor |
JIB 1.4.0 it's not good version to use, exactly for problems by auth. |
I'll reopen this issue since the problem doesn't seem to be resolved yet. |
Two times I tried to build Logs:
Is this issue related to internet? |
Was timeout ... |
1.8.0 |
18 minutes... that's a way long time to push. For me, pushing to Docker Hub takes only a few seconds. It looks like at some point something timed out and it led to Docker Hub not returning any HTTP response, hence "the target server failed to respond". So yes, a kind of a slow network issue. Is Docker Hub usually slow like this in your network? Does At least it doesn't look like you have an auth issue anymore. But FYI, using |
with docker push its taking <= 1 minute |
That's very interesting. We'd like to understand why it is slow with Jib. Could you follow these instructions to capture low-level HTTP traffic and timing information? Also pass the
while you have created a separate file for
Then strip out any sensitive info and upload the file here (drag-and-drop a file into a GitHub comment input box). |
Logs of a build which is currently in progress 1.8.0 version.Getting unauthorised
|
Thanks for the quick turnaround. That is revealing. I am suspecting something here. I'll take a look. |
Logs from jenkins
|
Nah, nothing seems wrong. Still looks normal. @nithinkota can you upload the entire log file? And can't you try Jib locally on your laptop and not on Jenkins? |
@nithinkota sorry, you didn't provide But I already think the main trigger of the issue is your slow network interacting with Docker Hub. I see you have a BLOB of digest
And I can see from your log that uploading 1K can take as much as a second. Also, I see that in a previous instance, BLOBs you wanted to upload were already on Docker Hub and therefore Jib was able to skip uploading those BLOBs. But this time no BLOBs were on the target Docker Hub, so I suppose you are cleaning the target repo to start from a clean state. It'd be good to verify if the slow network is a triggering factor. Please carefully follow these instructions.
|
@chanseokoh I followed steps exactly whatever you have provided. |
I believe this is a duplicate of #691. The triggering factor seems to be the slow network. It will become certain once I can see the low-level HTTP requests and responses, but #691 is the only logical explanation that fits into this log.
You had those lines in #2207 (comment), so something must have not been configured correctly. Particularly,
But in any case, I believe the issue is #691. I'll close this as a dup. Please follow #691. |
To add, regarding auth, Jib was able to retrieve your login credentials (possibly from |
Today again I tried with this issue and internet speed is 54Mbps.
But I executed same command 4 times only for the first time generated file having these lines. From second generated files does not have these lines.
log-after-docker-push.txt ` |
Your log shows that authenticating to Docker Hub took more than 8 seconds.
It should normally take a fraction of a second. On my machine:
Your network may be fast in general. But accessing Docker Hub from your network is very slow. Don't worry. I think your issue is really a duplicate #691, and I'm working on fixing #691 as a priority. |
Just in case, can you also try this on a beefy/powerful machine? Just trying to rule out the possibility that this is due to some resources constrained on your machine. |
@chanseokoh |
I'll update here once it's fixed. And about not getting network traffic logs sometimes, I just remembered this comment. I should have recalled this weird behavior on Gradle, my bad. |
@chanseokoh |
I think the slow connection problem with Docker Hub is unique to your machine. Can you try some other machines within your network? And also your machine on a different network? Trying to see if it is primarily your network or your machine. |
@chanseokoh |
Cool.
I noticed the 33-minute build was for taking a log file when you used
Other than that, nothing seems wrong. It will be interesting to know if it is mainly your network or your machine that is accountable for the slow connection to Docker Hub. I'll think of something in the meantime. |
@chanseokoh
|
Yeah, I mean, for taking a log file, it helps to give |
I have written a tiny Java program that uploads random 40MB to Docker Hub. Could you test this out on your machine?
If all goes well, it should authenticate with Docker Hub and time uploading 40MB. On my machine, it takes 2.3 seconds.
Can you try this on your machine? |
@chanseokoh
|
Alright, just as I anticipated. One more test, and I think we're basically done. I've updated the tiny test program, so let's do this for the last time.
|
Build took approximately 14 minutes. elapsed (s): 836.9 |
Thanks for the update. As you have confirmed yourself, this conclusively proves that your connection to Docker Hub is inherently slow on your machine for some reason and the slow network issue is unrelated to Jib. This proof is as far as I can get you to; I think I've given you enough assistance on this case, and from now on, you're on your own. I'm sorry, but I just cannot spend infinite time to resolve any arbitrary network issues. |
@chanseokoh Thank you so much for your help |
I have logged in to docker hub through command prompt using
docker login
.Now I am trying to generate and push image to docker hub using command
gradlew jib --image=demo:0.0.1-SNAPSHOT
.I am getting errorThe text was updated successfully, but these errors were encountered: