Skip to content

Conversation

@hsw
Copy link

@hsw hsw commented Dec 7, 2025

The -D/--debug flag was not enabling debug logging in standalone mode.

Root cause: debug.Enable() was called before dockerCli.Initialize(), but Initialize() calls SetLogLevel("") which resets logrus level to Info, and since options.Debug was false, it wasn't re-enabled.

Fix: Pass opt.debug to options.Debug before Initialize() so it properly enables debug level after SetLogLevel().

Test case

Dockerfile

FROM alpine:3.19
MAINTAINER [email protected]

Before (bug):

$ ./docker-buildx -D build .
1 warning found (use docker --debug to expand):

After (fix):

$ ./docker-buildx -D build .
1 warning found:
The MAINTAINER instruction is deprecated...
More info: https://docs.docker.com/go/dockerfile/rule/maintainer-deprecated/

The -D/--debug flag was not enabling debug logging in standalone mode.

Root cause: debug.Enable() was called before dockerCli.Initialize(),
but Initialize() calls SetLogLevel("") which resets logrus level to
Info, and since options.Debug was false, it wasn't re-enabled.

Fix: Pass opt.debug to options.Debug before Initialize() so it
properly enables debug level after SetLogLevel().

Signed-off-by: Sergei Khomenkov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant