steampipe plugin install docker

Table: docker_compose_volume - Query Docker Compose Volumes using SQL

Docker Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Specifically, Docker Compose Volumes are used as a mechanism for persisting data generated by and used by Docker containers.

Table Usage Guide

The docker_compose_volume table provides insights into Docker Compose Volumes. As a DevOps engineer, explore volume-specific details through this table, including volume configuration, status, and associated metadata. Utilize it to uncover information about volumes, such as those with specific configurations, the status of volumes, and the verification of volume data.

Examples

Basic info

Explore which Docker Compose volumes are in use and determine their associated drivers. This can help identify instances where specific drivers or volumes may be causing issues, allowing for targeted troubleshooting and optimization.

select
name,
driver,
jsonb_pretty(driver_opts) as driver_opts,
jsonb_pretty(external) as external
from
docker_compose_volume;
select
name,
driver,
driver_opts,
external
from
docker_compose_volume;

List the external configuration of volumes

Explore the external setup of your storage spaces to understand how they are configured and managed. This is beneficial for reviewing and optimizing your storage utilization strategy.

select
name,
driver,
external ->> 'Name' as external_name,
external ->> 'External' as external,
external -> 'Extensions' as external_extensions
from
docker_compose_volume;
select
name,
driver,
json_extract(external, '$.Name') as external_name,
json_extract(external, '$.External') as external,
external as external_extensions
from
docker_compose_volume;

List volumes with local driver

Explore which Docker volumes are using the local driver. This can be used to assess the configuration for potential storage optimizations or to identify instances where a different driver might be more appropriate.

select
name,
driver,
jsonb_pretty(driver_opts) as driver_opts,
jsonb_pretty(external) as external
from
docker_compose_volume
where
driver = 'local';
select
name,
driver,
driver_opts,
external
from
docker_compose_volume
where
driver = 'local';

Schema for docker_compose_volume

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
drivertextDriver used for the volume.
driver_optsjsonbDriver options for the volume.
extensionsjsonbExtensions for the volume configuration.
externaljsonbExternal volume configuration.
labelsjsonbLabels for the volume.
nametextName of 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_compose_volume