1
0
mirror of https://github.com/docker/cli.git synced 2026-01-15 07:40:57 +03:00
Files
cli/components/engine/docs/sources/terms/container.rst
Sven Dowideit d772cfe673 make all image ID and container ID API responses use the Long ID (Closes #2098)
Upstream-commit: b3974abe4f01d408850e245c9b52c77f3571e0b2
Component: engine
2013-11-09 12:16:49 +10:00

1.7 KiB

title
Container
description
Definitions of a container
keywords
containers, lxc, concepts, explanation, image, container

Container

image

Once you start a process in Docker from an image_def, Docker fetches the image and its parent_image_def, and repeats the process until it reaches the base_image_def. Then the ufs_def adds a read-write layer on top. That read-write layer, plus the information about its parent_image_def and some additional information like its unique id, networking configuration, and resource limits is called a container.

Container State

Containers can change, and so they have state. A container may be running or exited.

When a container is running, the idea of a "container" also includes a tree of processes running on the CPU, isolated from the other processes running on the host.

When the container is exited, the state of the file system and its exit value is preserved. You can start, stop, and restart a container. The processes restart from scratch (their memory state is not preserved in a container), but the file system is just as it was when the container was stopped.

You can promote a container to an image_def with docker commit. Once a container is an image, you can use it as a parent for new containers.

Container IDs

All containers are identified by a 64 hexadecimal digit string (internally a 256bit value). To simplify their use, a short ID of the first 12 characters can be used on the commandline. There is a small possibility of short id collisions, so the docker server will always return the long ID.