Переглянути джерело

lets talk about the other way to make base images

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
Sven Dowideit 11 роки тому
батько
коміт
9f1c69ca7b
1 змінених файлів з 21 додано та 2 видалено
  1. 21 2
      docs/sources/articles/baseimages.rst

+ 21 - 2
docs/sources/articles/baseimages.rst

@@ -13,8 +13,8 @@ The specific process will depend heavily on the Linux distribution you
 want to package. We have some examples below, and you are encouraged
 want to package. We have some examples below, and you are encouraged
 to submit pull requests to contribute new ones.
 to submit pull requests to contribute new ones.
 
 
-Getting Started
-...............
+Create a full image using tar
+.............................
 
 
 In general, you'll want to start with a working machine that is
 In general, you'll want to start with a working machine that is
 running the distribution you'd like to package as a base image, though
 running the distribution you'd like to package as a base image, though
@@ -44,3 +44,22 @@ Docker GitHub Repo:
   <https://github.com/dotcloud/docker/blob/master/contrib/mkimage-yum.sh>`_
   <https://github.com/dotcloud/docker/blob/master/contrib/mkimage-yum.sh>`_
 * `Debian / Ubuntu
 * `Debian / Ubuntu
   <https://github.com/dotcloud/docker/blob/master/contrib/mkimage-debootstrap.sh>`_
   <https://github.com/dotcloud/docker/blob/master/contrib/mkimage-debootstrap.sh>`_
+
+
+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::
+
+    $ 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``::
+
+    FROM scratch
+    ADD true-asm /true
+    CMD ["/true"]
+
+The Dockerfile above is from extremely minimal image - 
+`tianon/true <https://github.com/tianon/dockerfiles/tree/master/true>`_.