steampipe plugin install docker

Table: docker_volume - Query Docker Volumes using SQL

Docker Volumes are a type of resource provided by the Docker service that allows persistent data storage and sharing among containers. They are designed to decouple the life of the data being stored from the life of the container, enabling data to persist even after a container is deleted. Docker Volumes are managed directly by Docker and are stored in a part of the host filesystem which is managed by Docker.

Table Usage Guide

The docker_volume table provides insights into Docker Volumes within Docker. As a DevOps engineer, explore volume-specific details through this table, including driver, labels, options, and scope. Utilize it to uncover information about volumes, such as those with specific labels, the options set for each volume, and the scope of each volume.

Examples

List all volumes

Explore all the storage volumes within your Docker environment to understand the usage and allocation. This can be beneficial for managing storage resources and optimizing performance.

select
*
from
docker_volume;
select
*
from
docker_volume;

Find all volumes with a given label

Identify all Docker volumes that are labeled as 'postgres'. This is useful for managing and organizing your Docker volumes, especially in large systems where volumes may not be consistently labeled.

select
*
from
docker_volume
where
labels ->> 'com.docker.compose.volume' = 'postgres';
select
*
from
docker_volume
where
json_extract(labels, '$.com.docker.compose.volume') = 'postgres';

Schema for docker_volume

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
createdtimestamp with time zoneTime when the volume was created.
drivertextName of the volume driver used by the volume.
labelsjsonbLabels for the volume.
mountpointtextMount path of the volume on the host.
nametextName of the volume.
optionsjsonbThe driver specific options used when creating the volume.
scopetextThe level at which the volume exists. Either global for cluster-wide, or local for machine level.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statusjsonbLow-level details about the volume, provided by the volume driver.
usage_datajsonbUsage data for the volume.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- docker

You can pass the configuration to the command with the --config argument:

steampipe_export_docker --config '<your_config>' docker_volume