查看container
#查看正在运行的container
[root@lydcentos7 centos6]# docker ps
#查看所有的container
[root@lydcentos7 centos6]# docker ps -a
#查看所有的container 的id
[root@lydcentos7 centos6]# docker ps -a -q
stop container
[root@lydcentos7 centos6]£ docker stop containerId
删除 container
#删除一个container
[root@lydcentos7 centos6]# docker rm containerId(containerName)
#删除所有container
[root@lydcentos7 centos6]# docker rm $(docker ps -a -q)
注:先stop container ,然后再rm。
查看image
[root@lydcentos7 centos6]# docker images
删除image
#删除一个image
[root@lydcentos7 centos6]# docker rmi imageId
注:先rm image上的所有的container,再rm 该image。