Skip to content
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

Make image build logs verbose if necessary #98568

Merged
merged 1 commit into from Feb 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions build/lib/release.sh
Expand Up @@ -383,12 +383,16 @@ EOF
echo "COPY nsswitch.conf /etc/" >> "${docker_file_path}"
fi

DOCKER_CLI_EXPERIMENTAL=enabled "${DOCKER[@]}" buildx build \
local build_log="${docker_build_path}/build.log"
if ! DOCKER_CLI_EXPERIMENTAL=enabled "${DOCKER[@]}" buildx build \
--platform linux/"${arch}" \
--load ${docker_build_opts:+"${docker_build_opts}"} \
-q \
-t "${docker_image_tag}" \
"${docker_build_path}" >/dev/null
"${docker_build_path}" >"${build_log}" 2>&1; then
Copy link
Member

@dims dims Feb 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

do we want to cleanup the file (when there is no problem)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM, @saschagrunert want to add that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, added a rm "${build_log}" after the if condition. 👍

cat "${build_log}"
exit 1
fi
rm "${build_log}"

# If we are building an official/alpha/beta release we want to keep
# docker images and tag them appropriately.
Expand Down