scratch

Docker's special empty base image, with no files at all, used to ship a single static binary and nothing else.

In more detail

An image built FROM scratch contains only what you copy in, so it has no shell, no package manager and no certificates or time zone data. That makes it tiny and leaves almost nothing to attack, but you cannot exec into it to debug. Copy in CA certificates if the program makes HTTPS calls.

Example

FROM scratch
COPY --from=build /out/app /app
ENTRYPOINT ["/app"]

Related terms

Taught in

References