Table: docker_compose_config - Query Docker Compose Configs using SQL
Docker Compose is a tool for defining and managing multi-container Docker applications. It allows users to configure application services in a YAML file, which can then be managed (start, stop, build, etc.) with a single command. Docker Compose is primarily used in the development, testing, and staging environments.
Table Usage Guide
The docker_compose_config
table provides insights into Docker Compose configurations. As a DevOps engineer, you can explore details of your Docker Compose files through this table, including the services, networks, volumes, and secrets defined within. Use it to uncover information about your Docker Compose configurations, such as those related to network and volume configurations, service dependencies, and secret management.
Examples
Basic info
Explore the fundamental details of a Docker Compose configuration to understand its environment, associated files, and the drivers in use. This can help in managing and debugging your Docker Compose setup effectively.
select name, file, environment, driver, template_driverfrom docker_compose_config;
select name, file, environment, driver, template_driverfrom docker_compose_config;
List the external configuration of configs
Explore the external settings of your configurations to understand how they interact with external systems or resources. This can be particularly useful when troubleshooting or optimizing your system's interaction with external elements.
select name, file, driver, external ->> 'Name' as external_name, external ->> 'External' as external, external -> 'Extensions' as external_extensionsfrom docker_compose_config;
select name, file, driver, json_extract(external, '$.Name') as external_name, json_extract(external, '$.External') as external, external as external_extensionsfrom docker_compose_config;
List configs with local driver
Explore which configurations within your Docker Compose setup are utilizing a local driver. This can be beneficial for assessing elements within your system that may be operating independently of network drivers, aiding in system management and optimization.
select name, file, environment, driver, template_driverfrom docker_compose_configwhere driver = 'local';
select name, file, environment, driver, template_driverfrom docker_compose_configwhere driver = 'local';
List configs without environment vars
Explore configurations that lack environment variables. This is useful for identifying potential areas in your Docker Compose setup that may need additional context or settings.
select name, file, driver, template_driverfrom docker_compose_configwhere environment is null;
select name, file, driver, template_driverfrom docker_compose_configwhere environment is null;
Schema for docker_compose_config
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
driver | text | Driver used for the config. | |
driver_opts | jsonb | Driver options for the config. | |
environment | text | Environment variable to use for the config. | |
extensions | jsonb | Extensions for the config configuration. | |
external | jsonb | External config configuration. | |
file | text | File to use for the config. | |
labels | jsonb | Labels for the config. | |
name | text | Name of the config. | |
template_driver | text | Template driver used for the config. |
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_config