LinuxCommandLibrary

docker-system

Manage Docker system resources and information

TLDR

Show Docker disk usage

$ docker system df
copy

Show detailed information on disk usage
$ docker system df [[-v|--verbose]]
copy

Remove unused data (append --volumes to remove unused volumes as well)
$ docker system prune
copy

Remove unused data created more than a specified amount of time in the past
$ docker system prune --filter "until=[hours]h[minutes]m"
copy

Display real-time events from the Docker daemon
$ docker system events
copy

Display real-time events from containers streamed as valid JSON Lines
$ docker system events [[-f|--filter]] 'type=container' --format '[json .]'
copy

Display system-wide information
$ docker system info
copy

Display help
$ docker system
copy

SYNOPSIS

docker system COMMAND [OPTIONS] [ARG...]

PARAMETERS

df [OPTIONS]
    Display Docker disk usage by images, containers, volumes, and build cache

events [OPTIONS]
    Stream real-time events from the Docker daemon

info [OPTIONS]
    Show system-wide information about Docker installation and configuration

prune [OPTIONS]
    Remove unused containers, networks, images, and optionally volumes or build cache

--help
    Show help for docker system

DESCRIPTION

docker system is a Docker CLI command used to inspect and manage the Docker daemon's resource consumption, primarily focusing on disk space, system events, and overall status. It helps administrators monitor storage used by images, containers, volumes, and build cache, preventing disk exhaustion on the host.

Common use cases include checking disk usage with df, retrieving real-time events via events, viewing comprehensive system details with info, and cleaning up unused resources using prune. The prune subcommand is particularly powerful, allowing selective or aggressive removal of dangling images, stopped containers, unused networks, and optionally all unused objects to free significant space.

This command requires the Docker daemon to be running and typically needs root or docker group privileges. It's essential for production environments where Docker workloads generate substantial data over time. Output is human-readable by default but supports JSON formatting for scripting. Regular use ensures efficient resource management and optimal performance.

CAVEATS

Requires Docker daemon running; prune operations are irreversible and may delete important data if not filtered carefully. Use -f or --filter for precision.

COMMON EXAMPLES

docker system df - View disk usage summary.
docker system prune -a - Aggressively remove all unused objects.
docker system info - Detailed Docker host info.

FILTERS SUPPORT

Prune subcommands accept --filter flag, e.g., --filter until=24h to remove objects older than 24 hours.

HISTORY

Introduced in Docker 1.13 (2017) to consolidate system management; evolved with Docker Engine releases, adding filters and force options in later versions like 17.06+ for safer pruning.

SEE ALSO

docker(1), docker-image-prune(1), docker-container-prune(1), docker-volume-prune(1)

Copied to clipboard