-
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
jib gets stuck at 'processing base image' when the base image comes from local docker daemon #4046
Comments
Hello all, I am facing the same issue as described, running on a Jenkins instance as gradle task with plugin on
This is occured like 3/5 pipeline triggers and I need to find a workaround or get the provided fix for this bug ASAP - since this is getting really annoying :/ . Thanks a lot, and especially you @EternalWind for providing a solution for that bug :) . |
@athtsio Since they are unlikely to be merging my fix any time soon, one workaround we have been using is docker's multi-stage build. We base the final image on a much simpler base image, e.g. a minimal Alpine image, instead of the desired base image. Then, we use the desired base image as a builder image and copy out all of the desired files from it since the instructions from a builder image are not going into the final image. Of course, this is based on the assumption that most of the instructions you want from the desired base image are installing packages or copying files. Hopefully the fix could be merged soon. |
@EternalWind thanks for the response/suggestion. The base image is really minimal. It is built and published in a registry. This means that we do not have to build this base image each time we need to dockerize the app. We take it/use it as is in the one single FROM in the Dockerfile. On top of that base image, we built the image that will be used from the jib task which is like the base image plus 3 new packages installed, copy and run a script that imports the aws rds certificates. Nothing more ! My point is that the instructions are literally 10 lines. I do not know if by adding --no-cache on docker build will bring any difference...or make things worse 😭 |
Any progress? On 3.4.3 is getting stuck on "building image to Docker daemon step". Don't know if it's the same.
|
@artemik |
Reverting to 3.4.2 fixed indefinite hang. idk what the problem was, it wasn't happening, then it was 100% repeatable - couldn't build anything. was hung here, but i couldn't find any obvious running thread doing anything...
|
Description of the issue
When reading the base image from local docker daemon, if the base image is built from a dockerfile consisting of a relatively huge amount of instructions(example here), jib will stuck at 'processing base image' forever like below.
Root cause
When inspecting the base image from docker daemon, jib invokes Process.waitFor() immediately without reading from stdout. It only tries to read from stdout after waitFor() returns, i.e. the process terminates.
If the size of the output is significant enough to overwhelm the buffer, the process would become pending until someone read from its stdout to clear out the buffer. This results in a deadlock that makes waitFor() never returns.
Proposed fix
Updates the implementation of CliDockerClient.inspect() as below.
The text was updated successfully, but these errors were encountered: