docker容器的基本操作
0x000 启动一个容器
docker run IMAGE [COMMAND] [ARGS....]
run 再容器中执行的命令
ctrl+p ctrl+q 让容器在后台运行
0x001 启动一个交互式容器
docker run -i -t IMAGE /bin/bash
-i interactive=true | false 默认是false
-t tty=true | false 默认是false
-i:告诉docker的守护进程,为容器始终打开标准输入
-t:为容器分配一个伪tty终端
-d:以后台的方式来运行容器
0X002 查看容器
docker ps [-a] [-l]
-a 列出所有的的容器进程
-l 列出最新的容器使用进程
docker inspect [ID]|[NAME]
````````````````````````````````````
0x003 自定义容器名
````````````````````````````````````
docker run --name=自定义名 -i -t [IMAGE /bin/bash
```````````````````````````````````
0x004 重新启动停止的容器
```````````````````````````````````
docker start [-i] 容器名
``````````````````````````````````
0x005 删除容器
``````````````````````````````````
docker run 容器名
``````````````````````````````````
0x006 查看和删除镜像
``````````````````````````````````
docker image [OPTIONS] [REPOSITORY]
-a --all=false 列出所有的镜像,默认不显示中间层的镜像
-f --filter=fase 过滤条件
--no-trunc=false 指定不截断的形式显示数据
-q --quiet=false 只显示镜像的ID
docker rmi image [image....]
-f, --force Force removal of the image
--help Print usage
--no-prune Do not delete untagged parents
````````````````````````````````````
0x007 获取和搜索镜像
```````````````````````````````````
docker pull image
docker search image
```````````````````````````````````
0x008 附加到运行中的容器
`````````````````````````````````
docker attach 容器名
`````````````````````````````````
0x009 查看运行中容器的进程
`````````````````````````````````
docker top 容器名称
````````````````````````````````
0x010 查看容器日志(查看容器内部运行的情况)
docker logs [-f] [-t] [--tail] 容器名
-f --fllows=true | false 默认是false (一直跟踪日志的变化并返回结果)
-t --timestamps=true | false 默认是false(返回结果并加上时间戳)
--tail="all" 在结尾处显示日志的数量
0x011 停止守护式容器
```````````````````````````````````
docker stop container_name(已发送信号的方式)
docker kill container_name(直接停止容器)