baseimages.rst 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. :title: Create a Base Image
  2. :description: How to create base images
  3. :keywords: Examples, Usage, base image, docker, documentation, examples
  4. .. _base_image_creation:
  5. Create a Base Image
  6. ===================
  7. So you want to create your own :ref:`base_image_def`? Great!
  8. The specific process will depend heavily on the Linux distribution you
  9. want to package. We have some examples below, and you are encouraged
  10. to submit pull requests to contribute new ones.
  11. Getting Started
  12. ...............
  13. In general, you'll want to start with a working machine that is
  14. running the distribution you'd like to package as a base image, though
  15. that is not required for some tools like Debian's `Debootstrap
  16. <https://wiki.debian.org/Debootstrap>`_, which you can also use to
  17. build Ubuntu images.
  18. It can be as simple as this to create an Ubuntu base image::
  19. $ sudo debootstrap raring raring > /dev/null
  20. $ sudo tar -C raring -c . | sudo docker import - raring
  21. a29c15f1bf7a
  22. $ sudo docker run raring cat /etc/lsb-release
  23. DISTRIB_ID=Ubuntu
  24. DISTRIB_RELEASE=13.04
  25. DISTRIB_CODENAME=raring
  26. DISTRIB_DESCRIPTION="Ubuntu 13.04"
  27. There are more example scripts for creating base images in the
  28. Docker Github Repo:
  29. * `BusyBox <https://github.com/dotcloud/docker/blob/master/contrib/mkimage-busybox.sh>`_
  30. * `CentOS / Scientific Linux CERN (SLC)
  31. <https://github.com/dotcloud/docker/blob/master/contrib/mkimage-rinse.sh>`_
  32. * `Debian / Ubuntu
  33. <https://github.com/dotcloud/docker/blob/master/contrib/mkimage-debootstrap.sh>`_