Docker - 基础命令

查看正在运行的docker 容器

1:docker ps
# look for all is runing docker container
# -l :look last info

查看docker中所有的镜像

2:docker images
# look for all images 

启动镜像 并且在后台进行运行

3:docker  run -d -P imageName python? app.py?
# -d : This programmer will run in background.
# -P : This programmer port will equal image port in net.

docker 运行镜像 并且设置本地服务端口

4:docker  run -d -p 5000:5000 imageName python? app.py?
# -d : This programmer will run in background.
# -p : This programmer port set 5000

查询容器中服务端口

5:docker port containerId
# port: get programmer port

标准输出容器HTTP请求信息 Ctrl+C 退出

6:docker logs -f containerId
# logs : console http request every message.
#-f: output standard text.
!Ctrl+C will exit.

查询容器信息 比如PID User command

7:docker top  containerId
# top:get PID USER COMMAND info.

查询docker容器详细信息

8:docker inspect  containerId
# inspect : get json  include container all detail info.

停止容器的运行

9:docker stop containerId
# stop: stop is programmer.

启动容器

10:docker start containerId
# start : start is programmer.

重新启动容器

11:docker restart containerId
# restart : restart has runing programmer.

删除容器

12:docker rm containerId
# restart : delete runing programmer before need stop pragrammer.

你可能感兴趣的:(Docker - 基础命令)