docker / buildx

Docker CLI plugin for extended build capabilities with BuildKit
Apache License 2.0
3.33k stars 448 forks source link

bake: print warnings on progress #2534

Closed tonistiigi closed 3 days ago

tonistiigi commented 2 weeks ago

Add progress warnings to the output for bake commands same way as they show up in build.

 1 warning found (use --debug to expand):
 - UndefinedVar: Usage of undefined variable '$PAHT' (did you mean $PATH?) (line 2)
 1 warning found:
 - UndefinedVar: Usage of undefined variable '$PAHT' (did you mean $PATH?) (line 2)
Variables should be defined before their use
More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
Dockerfile:2
--------------------
   1 |     FROM alpine
   2 | >>> ENV PATH=$PAHT:/foo
   3 |     RUN env && stop
   4 |
--------------------

--

There is a bit of an issue with this atm that when two targets invoked by bake use the same Dockerfile they are likely to generate the same warnings. Some deduplication would be needed.

tonistiigi commented 1 week ago

https://github.com/docker/buildx/pull/2551/files#diff-005a09d9d83039339e043f46660ad7cebb258f5c9e2163bf5863a7567dae226bR190 started to add dedupe functionality that can be reused in here (@crazy-max )

tonistiigi commented 1 week ago

Issue with duplication was fixed in #2551