[Feature Request]: Add Debug Log switch (-ld
) and Context Log switch (-lcd
) to docker build
, outputting what’s actually executed
#47791
Labels
area/builder/classic-builder
Issues affecting the classic builder
area/builder
kind/feature
Functionality or other elements that the project doesn't currently have. Features are new and shiny
status/0-triage
Description
Running
docker build
for a Dockerfile, it’s incredibly hard to tell the result of variable replacement or path conversion, particularly when using Windows containers.Please, add two logging options to
docker build
, supposed to be outputting the Docker daemon’s context content and the actual result of parsing an instruction:--log-context-depth
{unsigned byte}, or-lcd
{unsigned byte}(default value: 0)
--log-debug
, or-ld
--log-context-depth
{unsigned byte}Providing a
--log-context-depth
with a value greater than 0 todocker build
should result in outputting the content of the Docker daemon’s context in a way that would allow to copy/paste individual entries of the log output to aCOPY
instruction, i.e., this option should output absolute paths in a format that’s accepted by theCOPY
instruction. The depth value is supposed to be used to limit the depth of sub directorys being output.Examples
Given the following folder structure:
This is the suggested output when using
--log-context-depth
:--log-debug
Providing this command line argument should result in logging the actual instruction that’s being executed in the writable layer of the container, after variables have been replaced and paths have been canonicalized.
Examples
Given a Dockerfile content like this:
This is the suggested output when using
--log-debug
:The text was updated successfully, but these errors were encountered: