VM - Container (Ligthweight VM) in Docker.
A container is a running instance of an image.
Docker containers only run as long as the command you specify is active.
A container ID uniquely identifies a container.
A container ID has two versions:
By running bash on the Ubuntu Image,
$ docker run -t -i ubuntu bash
You can see the container id in the prompt (here: c94698e7ab68)
root@c94698e7ab68:/#
You can get a container Id by name with:
docker container ls -qf name=containerName
10aca1bd6d00
A container acquire a name:
The daemon cannot run the two type of container. Therefore you need to switch the daemon by switching the type of containers. Example with docker for windows
The build version with inspect.
docker inspect -f '{{ index .Config.Labels "build_version" }}' <container_name>
The docker ps']]' command queries the Docker daemon for information about all the containers it knows about. See Docker - ps (List containers)
=== All ===
Docker - info gives also information:
Containers: 9
Running: 1
Paused: 0
Stopped: 8
==== Logs ==== See Docker - logs of a container ==== Stop ==== Docker - Stop (a container) ==== Kill ==== docker kill - Kill one or more running containers ==== Diff ==== A list of files created or modified sinds a docker run. Inspect changes on a container's filesystem
docker diff container_name==== Restart ==== The docker restart command that runs a stop and then start on the container. ==== Remove ====
docker rm [OPTIONS] CONTAINER [CONTAINER…]Remove one or more containers Options: * -f, –force Force the removal of a running container (uses SIGKILL) * –help Print usage * -l, –link Remove the specified link * -v, –volumes Remove the volumes associated with the container ==== Configuration and status information (IP, …)==== Docker - Inspect ==== Process ==== Docker - Top (Process)