question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docker Build Image may wrongly read status for #isBuildSuccessIndicated

See original GitHub issue

I’ve just spotted this bug when I tried to build the image where in Dockerfile I install some python modules via pip3 (using RUN). The image building should have failed as the result of RUN chained commands returned non-zero result but (!) the Benjamin’s gradle-docker-plugin stated that it succeeded.

That was strange enough so I started to investigate. I found that python module installation via pip3 prints something like this: Successfully built jsondiff wrapt PyYAML future pycparser causing:

  • the gradle task to succeed even though it shouldn’t have (due to non-zero exit code)
  • Benjamin’s plugin to print something like this: Created image with ID 'jsondiff wrapt PyYAML future pycparser' and probably such bizarre image id is used later on.

Even if image creation was successful (RUN command returned success) I’m afraid that wrong image id could be picked up.

The problem is in BuildResponseItem#BUILD_SUCCESS && BuildResponseItem#isBuildSuccessIndicated. I’m not sure what other programmatic option can be used to check if build was successful besides tracing logs, but if logs really must be used, then I would suggest to enhance BUILD_SUCCESS pattern to include regexp of the ID pattern (or check BUILD_SUCCESS first and then check the ID presence using regexp to save some CPU cycles). Or maybe BuildResponseItem should wait for very last lines somehow?

The sample output from docker image build is:

Successfully built c0d3ff212415
Successfully tagged abc:latest <-- optional

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pskowronekcommented, Jun 19, 2020

I still persist that this issue should be addressed.

0reactions
pskowronekcommented, Aug 8, 2020

Please re-open, don’t ignore this issue just like that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker build - Docker Documentation
The docker build command builds Docker images from a Dockerfile and a “context”. A build's context is the set of files located in...
Read more >
Why new Macs break your Docker build, and how to fix it
New Macs can break your Docker image build in unexpected ways; learn why, and how to fix it.
Read more >
What's Wrong With The Docker :latest Tag? - vsupalov.com
It's just the tag which is applied to an image by default which does not have a tag. Those two commands will both...
Read more >
Understanding and Building Docker Images - JFrog
A Docker image is a read-only template that contains a set of instructions for creating a container that can run on the Docker...
Read more >
Troubleshoot environment images - Azure Machine Learning
Learn how to troubleshoot issues with environment image builds and ... and Docker images that correspond to AzureML environments may be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found