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 externalfrom docker_compose_volume;
select name, driver, driver_opts, externalfrom 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_extensionsfrom docker_compose_volume;
select name, driver, json_extract(external, '$.Name') as external_name, json_extract(external, '$.External') as external, external as external_extensionsfrom 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 externalfrom docker_compose_volumewhere driver = 'local';
select name, driver, driver_opts, externalfrom docker_compose_volumewhere driver = 'local';
Schema for docker_compose_volume
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
driver | text | Driver used for the volume. | |
driver_opts | jsonb | Driver options for the volume. | |
extensions | jsonb | Extensions for the volume configuration. | |
external | jsonb | External volume configuration. | |
labels | jsonb | Labels for the volume. | |
name | text | Name of the volume. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. |
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