by MarkSweep · 2y ago · 0 comments
FROM scratch
COPY --from=qemux/qemu-docker:4.14 / /
Is this different than the following? FROM qemux/qemu-docker:4.14I don’t see any benefits. Security scanners have a harder time to track issues, because they can’t just detect the image is depending on an insecure base image.
It also strips the possibility to deduplicate some base layers, or a partial pull if you already have one of the base layers in the cache (Debian or Ubuntu are very common, you might have even the exact same version already in the layer cache).
If a layer creates a file and then a subsequent layer deletes it, the deleted file is still present in the image taking up space. If you squash the layers, the deleted file is gone
“scratch” used to be an empty layer, but in newer versions is now just syntax to state that you want a layer without a parent layer