LinuxCommandLibrary

docker-container-diff

Show filesystem changes inside a container

TLDR

View documentation for the original command

$ tldr docker diff
copy

SYNOPSIS

docker diff CONTAINER

PARAMETERS

CONTAINER
    The name or ID of the Docker container to inspect for filesystem differences.

DESCRIPTION

The command 'docker-container-diff' is not a standard, built-in command of the Docker CLI. However, the functionality it implies—inspecting differences in a Docker container's filesystem—is primarily provided by the built-in docker diff command. This command allows users to view changes made to a running or stopped container's filesystem relative to its original image. It provides a simple output format indicating added, deleted, or modified files and directories. For more advanced comparisons, particularly between container images or for detailed analysis of layers and contents (like packages), external tools such as 'container-diff' (developed by Google) are often used. This entry describes the capabilities typically associated with 'docker-container-diff' through the lens of the docker diff command.

CAVEATS

The command 'docker-container-diff' is not a standard Docker CLI command. The functionality described here pertains to the built-in docker diff command.

The docker diff command only shows differences in the filesystem of a container relative to its base image. It does not provide insights into other changes such as process status, network configuration, environment variables, or resource usage. It also doesn't compare the state of a container to another container or a local directory directly.

OUTPUT FORMAT

The output of docker diff uses single-character prefixes to indicate the type of change:
A: A file or directory has been Added.
D: A file or directory has been Deleted.
C: A file or directory has been Changed (modified content or metadata).

COMPARING CONTAINER IMAGES

While docker diff focuses on a running container's filesystem, comparing two Docker images (e.g., to see changes between versions) requires different tools. Tools like 'container-diff' (by Google) offer more comprehensive capabilities for comparing image layers, installed packages, or specific file contents across different image versions or sources.

HISTORY

The docker diff command has been a fundamental part of the Docker CLI since its early versions. It provides a straightforward way for developers and system administrators to quickly ascertain what changes have occurred within a container's writable layer during its lifecycle. Its simplicity and direct utility have made it a persistent and useful tool in Docker's suite of commands, often used for debugging, security auditing, or understanding application behavior inside containers.

SEE ALSO

docker diff(1), docker inspect(1), docker run(1)

Copied to clipboard