Official Repository

Last pushed: 4 years ago
Short Description
an explicitly empty image, especially for building images "FROM scratch"
Full Description

FROM scratch

This image is most useful in the context of building base images (such as debian and busybox) or super minimal images (that contain only a single binary and whatever it requires, such as hello-world).

As of Docker 1.5.0 (specifically, docker/docker#8827), FROM scratch is a no-op in the Dockerfile, and will not create an extra layer in your image (so a previously 2-layer image will be a 1-layer image instead).

Docker Pull Command

Comments (5)
daniells
4 months ago

While scratch appears in Docker’s repository on the hub, you can’t pull it, run it, or tag any image with the name scratch. Instead, you can refer to it in your Dockerfile. For example, to create a minimal container using scratch:

FROM scratch
ADD hello /
CMD ["/hello"]

see: https://docs.docker.com/engine/userguide/eng-image/baseimages/

ibigbug
10 months ago

That's really awesome and how does the scratch run the hello binary in hello-world image?

pbashyal
2 years ago

The doc says:

While scratch appears in Docker’s repository on the hub, you can’t pull it, run it, or tag any image with the name scratch. Instead, you can refer to it in your Dockerfile.

https://docs.docker.com/engine/articles/baseimages/

yogeshmsharma
2 years ago

Yes I am also facing same...
scratch is reserved word

dmlond
2 years ago

using Docker version 1.8.1, build d12ea79, I can no longer pull or use scratch.

$ docker pull scratch
Using default tag: latest
Error response from daemon: 'scratch' is a reserved name