← 返回命令列表

Linux command

docker-diff 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show filesystem changes in a container

docker diff [container_name]

Show changes using container ID

docker diff [container_id]

说明

docker diff inspects changes to files or directories on a container's filesystem since the container was created from its base image. The output categorizes each change with a single-character prefix: A for added, C for changed/modified, and D for deleted. This command is useful for understanding what modifications have occurred within a running or stopped container, which helps in debugging, auditing changes, or determining what should be captured in a new image via docker commit. Only changes in the container's writable layer are reported; the underlying image layers remain unchanged. You can reference the container by name or by full/shortened container ID.

FAQ

What is the docker-diff command used for?

docker diff inspects changes to files or directories on a container's filesystem since the container was created from its base image. The output categorizes each change with a single-character prefix: A for added, C for changed/modified, and D for deleted. This command is useful for understanding what modifications have occurred within a running or stopped container, which helps in debugging, auditing changes, or determining what should be captured in a new image via docker commit. Only changes in the container's writable layer are reported; the underlying image layers remain unchanged. You can reference the container by name or by full/shortened container ID.

How do I run a basic docker-diff example?

Run `docker diff [container_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more docker-diff examples?

This page includes 2 examples for docker-diff, plus related commands for nearby Linux tasks.