4-Docker command docker diff

1.Docker diff introduction

The docker diff command is used to compare file differences submitted by different versions of a docker container.

The docker diff command will list three file status changes in the container, namely: A-Add, D-Delete, C-Change

2.docker diff usage

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.Examples

3.1. List the differences between docker container files running in the background in the past

Order:

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

Guess you like

Origin blog.csdn.net/z19861216/article/details/134711063