4-Docker命令之docker diff

2023-12-17 06:32:40

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

文章来源:https://blog.csdn.net/z19861216/article/details/134711063
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。