Is it possible - either in legacy builder or in BuildKit?
Is cached steps stdout/stderr stored in the cached layer at all?
Unless something has changed, the output of commands is never stored in the image or cache. It would just make the size unecessarily huge when all you need is the layers. When something is loaded from cache, there is no need to run the steps at all, so there will be no output. When you want to test something, you can disable the cache.
Just imagine cached outputs appearing and showing a date from the past in the logs. You could also accidentally leak secrets if anything appears in the logs (output) and it is saved forever.
Hello!
Cached steps in Docker (legacy builder or BuildKit) don’t store stdout/stderr; the cache only keeps filesystem state EZPassWV login and metadata. That’s why you still see a cursor or “CACHED” message but no logs—if you need logs, you must capture them during the build or re‑run the step with --no-cache.