NAME 名称

podman-diff - Inspect changes on a container or image’s filesystem
podman-diff - 检查容器或镜像文件系统上的更改

SYNOPSIS 概要

podman diff [options] container|image [container|image]
podman diff [选项] 容器|镜像 [容器|镜像]

DESCRIPTION 描述

Displays changes on a container or image’s filesystem. The container or image is compared to its parent layer or the second argument when given.
显示容器或镜像文件系统上的更改。将容器或镜像与其父层或第二个参数进行比较(如果给定)。

The output is prefixed with the following symbols:
输出以以下符号为前缀:

Symbol

Description

A

A file or directory was added.
文件或目录已添加。

D

A file or directory was deleted.
文件或目录已删除。

C

A file or directory was changed.
文件或目录已更改。

OPTIONS 选项

--format

Alter the output into a different format. The only valid format for podman diff is json.
将输出更改为不同的格式。podman diff 的唯一有效格式是 json

--latest, -l

Instead of providing the container name or ID, use the last created container. Note: the last started container can be from other users of Podman on the host machine. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
不要提供容器名称或 ID,而是使用最后创建的容器。注意:最后启动的容器可能来自主机上其他 Podman 用户。(此选项在远程 Podman 客户端中不可用,包括 Mac 和 Windows(不包括 WSL2)主机)

EXAMPLE 例子 ¶

Show container-modified files versus the container’s image:
显示容器修改的文件与容器的镜像之间的差异:

$ podman diff container1
A /myscript.sh

Show container-modified files versus the container’s image in JSON format:
以 JSON 格式显示容器修改的文件与容器的镜像之间的差异:

$ podman diff --format json myimage
{
  "changed": [
    "/usr",
    "/usr/local",
    "/usr/local/bin"
  ],
  "added": [
    "/usr/local/bin/docker-entrypoint.sh"
  ]
}

Show the difference between the specified container and the image:
展示指定容器和镜像之间的差异:

$ podman diff container1 image1
A /test

SEE ALSO 参见 ¶

podman(1), podman-container-diff(1), podman-image-diff(1)

HISTORY 历史 ¶

August 2017, Originally compiled by Ryan Cole rycole@redhat.com
2017 年 8 月,最初由 Ryan Cole rycole@redhat.com 编译