github.com/feiyang21687/docker@v1.5.0/docs/sources/terms/container.md (about)

     1  page_title: Container
     2  page_description: Definitions of a container
     3  page_keywords: containers, lxc, concepts, explanation, image, container
     4  
     5  # Container
     6  
     7  ## Introduction
     8  
     9  ![](/terms/images/docker-filesystems-busyboxrw.png)
    10  
    11  Once you start a process in Docker from an [*Image*](/terms/image), Docker
    12  fetches the image and its [*Parent Image*](/terms/image), and repeats the
    13  process until it reaches the [*Base Image*](/terms/image/#base-image-def). Then
    14  the [*Union File System*](/terms/layer) adds a read-write layer on top. That
    15  read-write layer, plus the information about its [*Parent
    16  Image*](/terms/image)
    17  and some additional information like its unique id, networking
    18  configuration, and resource limits is called a **container**.
    19  
    20  ## Container State
    21  
    22  Containers can change, and so they have state. A container may be
    23  **running** or **exited**.
    24  
    25  When a container is running, the idea of a "container" also includes a
    26  tree of processes running on the CPU, isolated from the other processes
    27  running on the host.
    28  
    29  When the container is exited, the state of the file system and its exit
    30  value is preserved. You can start, stop, and restart a container. The
    31  processes restart from scratch (their memory state is **not** preserved
    32  in a container), but the file system is just as it was when the
    33  container was stopped.
    34  
    35  You can promote a container to an [*Image*](/terms/image) with `docker commit`.
    36  Once a container is an image, you can use it as a parent for new containers.
    37  
    38  ## Container IDs
    39  
    40  All containers are identified by a 64 hexadecimal digit string
    41  (internally a 256bit value). To simplify their use, a short ID of the
    42  first 12 characters can be used on the command line. There is a small
    43  possibility of short id collisions, so the docker server will always
    44  return the long ID.