container.rst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.
  31. Container IDs
  32. .............
  33. All containers are identified by a 64 hexadecimal digit string (internally a 256bit
  34. value). To simplify their use, a short ID of the first 12 characters can be used
  35. on the commandline. There is a small possibility of short id collisions, so the
  36. docker server will always return the long ID.