mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Make image build logs verbose if necessary
The `-q` flag is not implemented by `docker buildx`, which results in an output: ``` WARN[0000] quiet currently not implemented. ``` In the same way, the build output is not logged to `stdout` (but `stderr`). This means we now dump the whole build process to a file and if the `docker buildx` command fails, then we output those logs by printing the contents of that file. This will also reduce the overall verbosity and aligns to the original `docker build` behavior. Signed-off-by: Sascha Grunert <mail@saschagrunert.de>
This commit is contained in:
		@@ -383,12 +383,16 @@ EOF
 | 
				
			|||||||
          echo "COPY nsswitch.conf /etc/" >> "${docker_file_path}"
 | 
					          echo "COPY nsswitch.conf /etc/" >> "${docker_file_path}"
 | 
				
			||||||
        fi
 | 
					        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}" \
 | 
					          --platform linux/"${arch}" \
 | 
				
			||||||
          --load ${docker_build_opts:+"${docker_build_opts}"} \
 | 
					          --load ${docker_build_opts:+"${docker_build_opts}"} \
 | 
				
			||||||
          -q \
 | 
					 | 
				
			||||||
          -t "${docker_image_tag}" \
 | 
					          -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
 | 
					        # If we are building an official/alpha/beta release we want to keep
 | 
				
			||||||
        # docker images and tag them appropriately.
 | 
					        # docker images and tag them appropriately.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user