1.启动docker
systemctl start docker
停止
systemctl stop docker
重启
systemctl restart docker
开机启动
systemctl enable docker
2.查看docker状态
systemctl status docker
docker info
docker --help
3.查看docker有哪些镜像
docker images
4.查看都有哪些容器
docker ps -a
5.进入容器(containerID 是容器的ID)
运行容器
docker run imageID/imageName
如果报错
docker: Error response from daemon: pull access denied for 8d1297d92b54, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
执行
docker restart containerID
docker exec -it containerID /bin/bash
进入容器后执行ls,就可以查看容器有哪些内容
ls
6.清理docker run过程下载失败的内容
docker rmi $(sudo docker images --filter dangling=true -q)
|