瀏覽代碼

Merge pull request #12573 from clnperez/doc-article-baseimage

Update doc with usage of the scratch image
moxiegirl 10 年之前
父節點
當前提交
7c64ed5c8c
共有 1 個文件被更改,包括 8 次插入11 次删除
  1. 8 11
      docs/sources/articles/baseimages.md

+ 8 - 11
docs/sources/articles/baseimages.md

@@ -41,22 +41,19 @@ GitHub Repo:
  - [Debian / Ubuntu](
    https://github.com/docker/docker/blob/master/contrib/mkimage-debootstrap.sh)
 
-## Creating a simple base image using `scratch`
+## Creating a simple base image using scratch
 
-There is a special repository in the Docker registry called `scratch`, which
-was created using an empty tar file:
+You can use Docker's reserved, minimal image, `scratch`, as a starting point for building containers. Using the `scratch` "image" signals to the build process that you want the next command in the `Dockerfile` to be the first filesystem layer in your image.
 
-    $ tar cv --files-from /dev/null | docker import - scratch
-
-which you can `docker pull`. You can then use that
-image to base your new minimal containers `FROM`:
+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
-    COPY true-asm /true
-    CMD ["/true"]
+    ADD hello /
+    CMD ["/hello"]
+
+This example creates the hello-world image used in the tutorials.
+If you want to test it out, you can clone [the image repo](https://github.com/docker-library/hello-world)
 
-The `Dockerfile` above is from an extremely minimal image - [tianon/true](
-https://github.com/tianon/dockerfiles/tree/master/true).
 
 ## More resources