4-Docker命令之docker diff

1.docker diff介绍

docker diff命令是用于比较一个docker容器不同版本提交的文件差异

docker diff命令会列出容器内3种文件状态变化,分别是:A-Add,D-Delete,C-Change

2.docker diff用法

docker diff container

[root@centos79 ~]# docker diff --help

Usage:  docker diff CONTAINER

Inspect changes to files or directories on a container's filesystem

Aliases:
  docker container diff, docker diff
[root@centos79 ~]# 

3.实例

3.1.列出以往后台运行docker容器文件区别

命令:

docker diff centos-ssh

[root@centos79 ~]# docker ps -a | grep 803b
803b6b35366a   centos-ssh:1.0         "/bin/sh -c '/usr/sb…"   22 hours ago    Up About a minute   0.0.0.0:32768->22/tcp, :::32768->22/tcp                                                centos-ssh
[root@centos79 ~]# docker diff centos-ssh | tail -n 20
A /usr/share/vim/vimfiles/after/lang
A /usr/share/vim/vimfiles/after/spell
A /usr/share/vim/vimfiles/a

你可能感兴趣的:(docker,docker,容器)