Table: docker_image - Query Docker Images using SQL
Docker Images are read-only templates that you use to create Docker containers. They are the building blocks of a Docker container and contain the necessary components to run an application. Docker Images are created from a set of instructions, known as a Dockerfile, and can be stored and shared across different Docker hosts.
Table Usage Guide
The docker_image
table provides insights into Docker Images within the Docker system. As a DevOps engineer, you can explore image-specific details through this table, including image ID, parent ID, and image size. Utilize it to uncover information about images, such as those with specific tags, the layers within each image, and the verification of image metadata.
Examples
List all images
Explore all available images within your Docker system using this query. It's useful for quickly assessing the overall state of your Docker images, helping you manage resources and plan for future needs.
select *from docker_image;
select *from docker_image;
Find an image by tag
Explore which Docker images are associated with a specific tag, such as 'postgres:latest'. This can be useful in managing and organizing your Docker images based on their tags.
select *from docker_imagewhere repo_tags ? 'postgres:latest'
Error: SQLite does not support the '?' operator for checking the existence of a key in a JSON object.
Schema for docker_image
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
created | timestamp with time zone | Time when the image was created. | |
id | text | ID of the image. | |
labels | jsonb | Labels for the image. | |
parent_id | text | Parent ID of the image. | |
repo_digests | jsonb | Repository digests for the image. | |
repo_tags | jsonb | Repository tags for the image. | |
size | bigint | Size of the image in bytes. | |
virtual_size | bigint | Virtual size of the image in bytes. |
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_image