container.rst 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. :title: Container
  2. :description: Definitions of a container
  3. :keywords: containers, lxc, concepts, explanation, image, container
  4. .. _container_def:
  5. Container
  6. =========
  7. .. image:: images/docker-filesystems-busyboxrw.png
  8. Once you start a process in Docker from an :ref:`image_def`, Docker
  9. fetches the image and its :ref:`parent_image_def`, and repeats the
  10. process until it reaches the :ref:`base_image_def`. Then the
  11. :ref:`ufs_def` adds a read-write layer on top. That read-write layer,
  12. plus the information about its :ref:`parent_image_def` and some
  13. additional information like its unique id, networking configuration,
  14. and resource limits is called a **container**.
  15. .. _container_state_def:
  16. Container State
  17. ...............
  18. Containers can change, and so they have state. A container may be
  19. **running** or **exited**.
  20. When a container is running, the idea of a "container" also includes a
  21. tree of processes running on the CPU, isolated from the other
  22. processes running on the host.
  23. When the container is exited, the state of the file system and
  24. its exit value is preserved. You can start, stop, and restart a
  25. container. The processes restart from scratch (their memory state is
  26. **not** preserved in a container), but the file system is just as it
  27. was when the container was stopped.
  28. You can promote a container to an :ref:`image_def` with ``docker
  29. commit``. Once a container is an image, you can use it as a parent for
  30. new containers.