Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Build missing intermediate layers in console output

Tags:

docker

build

don't know weather it is an issue with Docker / Shell / BigSur Update, but a normal Docker Build Command like:

docker build -f Dockerfile -t MYIMAGE .

recently started to change the default output and is now missing the intermediate layers:

enter image description here

VS. the old output which included the ID's of the intermediate layers: enter image description here

How can we trigger the output of this information, as the official doc's don't say anything about it.

Docker version 20.10.2

Thanks and best regards

like image 282
flymg Avatar asked May 24 '26 16:05

flymg


1 Answers

BuildKit is a new build backend for Docker, with many new useful features, and faster builds (see https://pythonspeed.com/articles/docker-buildkit/ on why it's useful).

However, one of the ways it speeds things up is by not storing intermediate layers.

As of Docker Desktop released in fall 2020, BuildKit is enabled by default. However, it's possible you can disable it in Settings and get the old behavior. However, this will lose the speedups and features of BuildKit, so a better approach might be figuring out how to achieve what you want without that.

For example, if this is "how do I debug failed build", you can just comment out all lines in the Dockerfile starting with the failing line, and then rebuild; it'll be fast due to caching, and then you have the intermediate image for debugging.

like image 91
Itamar Turner-Trauring Avatar answered May 26 '26 09:05

Itamar Turner-Trauring



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!