-
Notifications
You must be signed in to change notification settings - Fork 76
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
Resolving issue - #35 - Error display when docker-build perform #227
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking at this. However it gives the code backtrace from the code path and not the error from the underlying command that I'd like to expose.
You can see if you run rocker --user hello-world --noex
that it still prints Exception: Build failed: no more output and success not detected
with the backgrace
What it should print is the error from the build step.
If you run it after the above and substitute the last image id into this command docker run -ti --rm 4939e01e77c4
You'll see the useful error: docker: Error response from daemon: unable to find user root: no matching entries in passwd file.
Which is what should be visible to the user as that's the underlying error not the backtrace.
3db01af
to
4db8835
Compare
ef95f76
to
8cfe4a1
Compare
@tfoote Would you like to review the code to see if the build errors can be traced back more clearly? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does print the build commands.
Exception: Build failed: Step 1/7 : FROM hello-world
---> feb5d9fea6a5
Step 2/7 : USER root
---> Using cache
---> 4939e01e77c4
Step 3/7 : RUN if ! command -v sudo >/dev/null; then apt-get update && apt-get install -y sudo && apt-get clean; fi
---> Running in 5a5af0f73975
But it doesn't print the underlying error so that the user can know what failed.
And secondly, just throwing the exception and printing the build output is not a good user experience. The exception should be caught and helpful context should be supplied to the user about what was being tried to run, what the error was, and hopefully how they can reproduce it for debugging.
59b6c2e
to
77a6d2c
Compare
hi @tfoote, I apologize for being inactive on this PR, but, can you please help with what should I change? |
You need to catch the underlying build error output. And then present what was attempted as well as the error output for the user to understand what failed so they can then fix the problem themselves. |
The issue of suppressed output when encountering build errors in the docker_build function has been resolved by modifying the code to handle errors by capturing and printing the output message instead of suppressing it. The modified code now allows users to see the full error message and easily diagnose the issue.
Fixes #35
@tfoote