(1)查看运行中的容器: sudo docker ps
(2)拉取镜像:docker pull ubuntu
(3)启动容器,并进去命令行:docker run -it ubuntu /bin/bash
(4)启动已停止的容器: docker start containerID
(5)停止容器:docker stop id
(6)重启容器:docker restart id
(7)进入正在运行的容器:docker exec -it id /bin/bash
(8)删除容器:docker rm -f id
(9)查询日志:docker logs -f bf08b7f2cd89
(10)查询镜像:docker images
(11)删除镜像:docker rmi hello-world
(12)端口映射:docker run -d -p 127.0.0.1:5001:5000 training/webapp python app.py
(13)配置mysql:docker run -itd --name mysql-dl -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql
(14)执行dockerfile命令:docker build -t nginx:test
(15)拷贝文件:docker cp 本地路径 容器长ID:容器路径