第7行: | 第7行: | ||
* debian: Debian distribution | * debian: Debian distribution | ||
* busybox: basic Busybox | * busybox: basic Busybox | ||
+ | * gcc: with GCC | ||
+ | ** gcc:5: gcc version 5 | ||
== Basic usage == | == Basic usage == |
2016年6月29日 (三) 22:28的版本
目录
Concepts
- Container ID: a long hex string. Usually its prefix is enough.
- Image: a template.
Common images
- ubuntu: Ubuntu distribution
- debian: Debian distribution
- busybox: basic Busybox
- gcc: with GCC
- gcc:5: gcc version 5
Basic usage
Get software image
docker pull <name>[:<version>]
Run
docker run -it <image name>
Attach
docker attach -ai <container ID>
Mount external directory
docker run -it -v <host directory>:<guest directory> <image name>
Management
List containers
docker ps -a
Only the running ones:
docker ps
Remove container
docker rm <container ID>
Get history console output
docker logs <container ID>
Create template from current container
docker commit <container ID> <new image name>
List images
docker images