Table: dockerhub_tag - Query DockerHub Tags using SQL
DockerHub is a cloud-based registry service that allows you to link to code repositories, build your images and test them, stores manually pushed images, and links to Docker Cloud so you can deploy images to your hosts. It provides a centralized resource for container image discovery, distribution and change management, user and team collaboration, and workflow automation throughout the development pipeline.
Table Usage Guide
The dockerhub_tag
table provides insights into the tags within DockerHub repositories. As a DevOps engineer, you can explore tag-specific details through this table, including the associated DockerHub repository, the tag name, and its manifest. Utilize this table to manage and monitor your DockerHub repositories, ensuring that all tags are up-to-date and follow your organization's naming conventions.
Examples
Basic info
Explore the status and usage of Docker images by identifying when they were last updated, pushed, or pulled, and their size. This allows for efficient management and tracking of Docker images in use.
select name, status, last_updater_user_name, last_pushed, last_pulled, full_sizefrom dockerhub_tag;
select name, status, last_updater_user_name, last_pushed, last_pulled, full_sizefrom dockerhub_tag;
List tags which are from a particular repository
Discover the segments that are from a specific repository, allowing you to analyze the status, last update, and size of these segments. This can be useful for managing and optimizing your repository's resources.
select name, status, last_updater_user_name, last_pushed, last_pulled, full_sizefrom dockerhub_tagwhere name like 'souravthe/test%';
select name, status, last_updater_user_name, last_pushed, last_pulled, full_sizefrom dockerhub_tagwhere name like 'souravthe/test%';
List tags with no pulls or downloads
Discover the segments that contain tags with no pulls or downloads in order to identify potentially unused or unpopular resources. This can be useful in optimizing resource allocation and improving overall system efficiency.
select name, status, last_updater_user_name, last_pushed, last_pulled, full_sizefrom dockerhub_tagwhere last_pulled is null;
select name, status, last_updater_user_name, last_pushed, last_pulled, full_sizefrom dockerhub_tagwhere last_pulled is null;
List tags which are not active
Discover the segments that contain tags which are not currently active. This provides valuable insights to assess and manage inactive components within your system.
select name, status, last_updater_user_name, last_pushed, last_pulled, full_sizefrom dockerhub_tagwhere status <> 'active';
select name, status, last_updater_user_name, last_pushed, last_pulled, full_sizefrom dockerhub_tagwhere status <> 'active';
List tags which are last updated by a particular user
Explore tags updated by someone other than a specific user to gain insights into the status, size, and last activities. This can help in tracking user contributions and managing resources effectively.
select name, status, last_updater_user_name, last_pushed, last_pulled, full_sizefrom dockerhub_tagwhere last_updater_user_name <> 'john';
select name, status, last_updater_user_name, last_pushed, last_pulled, full_sizefrom dockerhub_tagwhere last_updater_user_name <> 'john';
List of images associated with a particular tag
Explore the various attributes of images linked to a specific tag in a Docker Hub repository. This can help in understanding the characteristics of these images, such as their architecture, operating system, size, and status, as well as when they were last updated or accessed.
select name, i ->> 'Architecture' as architecture, i ->> 'Digest' as digest, i ->> 'LastPulled' as last_pulled, i ->> 'LastPushed' as last_pushed, i ->> 'Os' as os, i ->> 'Size' as size, i ->> 'Status' as status, i ->> 'Variant' as variantfrom dockerhub_tag, jsonb_array_elements(images) as iwhere name like 'souravthe/test:latest';
select name, json_extract(i.value, '$.Architecture') as architecture, json_extract(i.value, '$.Digest') as digest, json_extract(i.value, '$.LastPulled') as last_pulled, json_extract(i.value, '$.LastPushed') as last_pushed, json_extract(i.value, '$.Os') as os, json_extract(i.value, '$.Size') as size, json_extract(i.value, '$.Status') as status, json_extract(i.value, '$.Variant') as variantfrom dockerhub_tag, json_each(images) as iwhere name like 'souravthe/test:latest';
Schema for dockerhub_tag
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
full_size | bigint | Full size of the tag. | |
images | jsonb | List of images associated with the tag. | |
last_pulled | timestamp with time zone | Timestamp indicating when the tag was last pulled. | |
last_pushed | timestamp with time zone | Timestamp indicating when the tag was last pushed. | |
last_updated | timestamp with time zone | Timestamp indicating the last update time of the tag. | |
last_updater_user_name | text | Username by whom the tag was last updated. | |
name | text | Name of the tag. | |
status | text | Status of the tag. | |
title | text | Title of the resource. |
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)" -- dockerhub
You can pass the configuration to the command with the --config
argument:
steampipe_export_dockerhub --config '<your_config>' dockerhub_tag