[root@master ~]# docker diff b8bb59946198
C /etc
C /etc/nginx
C /etc/nginx/conf.d
C /etc/nginx/conf.d/default.conf
C /root
A /root/.bash_history
C /var
C /var/cache
C /var/cache/nginx
A /var/cache/nginx/proxy_temp
A /var/cache/nginx/scgi_temp
A /var/cache/nginx/uwsgi_temp
A /var/cache/nginx/client_temp
A /var/cache/nginx/fastcgi_temp
C /run
A /run/nginx.pid
A:代表添加一个文件
B:代表文件或者目录被删除
C:代表文件或者目录已经被更改
exec
Usage: docker exec[OPTIONS] CONTAINER COMMAND [ARG...]
Run a commandin a running container
Options:
-d, --detach 后台运行
--detach-keys string 指定退出的快捷键
-e, --env list 设置环境变量
-i, --interactive 保持输入流的打开,即时没有连接
--privileged 给命令赋予权限,测试时容器创建的时候没有带这个参数这里设置了好像也不起作用,run命令的时候有才会生效
-t, --tty 分配一个伪终端,通常和-i连用,进入容器
-u, --user string 登入的用户
-w, --workdir string 工作的文件夹
查看容器详情
Usage: docker inspect [OPTIONS] NAME|ID [NAME|ID...]
Return low-level information on Docker objects
Options:
-f, --format string 格式化输出
-s, --size 显示文件大小
--type string Return JSON for specified type
kill
Usage: docker container kill[OPTIONS] CONTAINER [CONTAINER...]
Kill one or more running containers
Options:
-s, --signal string Signal to send to the container (default "KILL")
logs
docker logs [OPTIONS] CONTAINER
Fetch the logs of a container
Options:
--details Show extra details provided to logs
-f, --follow Follow log output
--since string Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
--tail string Number of lines to show from the end of the logs (default "all")
-t, --timestamps Show timestamps
--until string Show logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
ls
Usage: docker container ls[OPTIONS]
List containers
Aliases:
ls, ps, list
Options:
-a, --all Show all containers (default shows just running)
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print containers using a Go template
-n, --last int Show n last created containers (includes all states)(default -1)
-l, --latest Show the latest created container (includes all states)
--no-trunc Don't truncate output
-q, --quiet Only display numeric IDs
-s, --size Display total file sizes
pause unpause
暂停一个容器
port
列出指定端口的映射
prune
慎用
rename
restart
rm
Usage: docker rm[OPTIONS] CONTAINER [CONTAINER...]
Remove one or more containers
Options:
-f, --force 通过 SIGKILL 信号强制删除一个运行中的容器
-l, --link 移除容器间的网络连接,而非容器本身
-v, --volumes 删除与容器关联的卷
start stop
status
显示实时的容器资源使用情况统计流
Usage: docker stats [OPTIONS][CONTAINER...]
Display a live stream of container(s) resource usage statistics
Options:
-a, --all Show all containers (default shows just running)
--format string Pretty-print images using a Go template
--no-stream Disable streaming stats and only pull the first result
--no-trunc Do not truncate output
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
b8bb59946198 web 0.00% 1.391MiB / 15.51GiB 0.01% 648B / 0B 0B / 1.02kB 2