Merge pull request #98568 from saschagrunert/buildx-log

Make image build logs verbose if necessary
This commit is contained in:
Kubernetes Prow Robot 2021-02-02 13:16:29 -08:00 committed by GitHub
commit 1a5080d82e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
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.