Table: dockerhub_repository - Query DockerHub Repositories 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_repository
table provides insights into repositories within DockerHub. As a DevOps engineer, explore repository-specific details through this table, including repository name, description, star count, pull count, and last updated date. Utilize it to uncover information about repositories, such as those with high pull counts, the most starred repositories, and recently updated repositories.
Important Notes
- The
namespace
column in thedockerhub_repository
table represents the repository namespace. By default, the namespace is set to the name of the authenticated user. To query repositories in a different namespace (e.g.turbot
orlibrary
), you can specify the namespace in thewhere
clause.
Examples
Basic info
Explore the popularity and privacy settings of repositories on DockerHub. This query can help you identify popular repositories with high pull and star counts, and understand the balance between public and private repositories.
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repository;
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repository;
List private repositories
Explore which DockerHub repositories are set as private to gain insights into the level of exposure and access. This is useful for auditing and understanding the privacy settings of your repositories.
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repositorywhere is_private;
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repositorywhere is_private = 1;
List public repositories owned by a different account
Explore public repositories on DockerHub which are not owned by the authenticated user and can be accessed by anyone. This query can help you get detailed information about public repositories in a specific namespace.
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repositorywhere namespace = 'turbot';
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repositorywhere namespace = 'turbot';
List repositories with no pulls or downloads
Explore which Docker repositories have not been pulled or downloaded. This can help identify unused or less-popular repositories, enabling you to better manage your resources and focus on active repositories.
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repositorywhere pull_count is null;
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repositorywhere pull_count is null;
List repositories that have not received any stars or likes
Explore which repositories have not gained any popularity or recognition, helping you identify potential areas for improvement or promotion. This query can be useful in understanding which of your repositories may need more attention or enhancement to increase their visibility and user engagement.
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repositorywhere star_count is null;
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repositorywhere star_count is null;
List repositories which have not been updated in the last 7 days
Determine the areas in which repositories have remained inactive over the past week. This query is useful for identifying potentially outdated or unused repositories, aiding in the efficient management of resources.
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repositorywhere last_updated > now() - interval '7' day;
select name, pull_count, star_count, is_private, last_updatedfrom dockerhub_repositorywhere last_updated > datetime('now', '-7 day');
Schema for dockerhub_repository
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | Docker Hub account ID. |
description | text | Description of the repository. | |
is_private | boolean | Boolean value indicating if the repository is private or not. | |
last_updated | timestamp with time zone | Timestamp indicating the last update time of the repository. | |
name | text | Name of the repository. | |
namespace | text | = | Namespace of the repository. |
pull_count | bigint | Number of pulls or downloads of the repository. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
star_count | bigint | Number of stars or likes received by the repository. | |
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_repository