百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

dockerhub-description

> DevOps
开源

从 README.md 更新 Docker 枢纽存储器描述的 GitHub动作

377 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

从 README.md 更新 Docker 枢纽存储器描述的 GitHub动作

Docker Hub Description

A GitHub action to update a Docker Hub repository description from README.md.

This is useful if you docker push your images to Docker Hub. It provides an easy, automated way to keep your Docker Hub repository description in sync with your GitHub repository README.md file.

Usage

yaml
    - uses: actions/checkout@v4

    - name: Docker Hub Description
      uses: peter-evans/dockerhub-description@v5
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_PASSWORD }}
        repository: peterevans/dockerhub-description

Action inputs

Name Description Default
username (required) Docker Hub username. If updating a Docker Hub repository belonging to an organization, this user must have Admin permissions for the repository.
password (required) Docker Hub password or Personal Access Token with read/write/delete scope.
repository Docker Hub repository in the format /. github.repository
short-description Docker Hub repository short description.
readme-filepath Path to the repository readme. ./README.md
enable-url-completion Enables completion of relative URLs to absolute ones. See also known Issues. false
image-extensions File extensions that will be treated as images. bmp,gif,jpg,jpeg,png,svg,webp

Content limits

DockerHub has content limits. The readme content is limited to 25,000 bytes, and short-description is limited to 100 bytes. This action truncates content to prevent the request being rejected. If the content has been truncated a warning will be issued in the run log.

Specifying the file path

The action assumes that there is a file called README.md located at the root of the repository. If this is not the case the path can be specified with the readme-filepath input.

yaml
    - name: Docker Hub Description
      uses: peter-evans/dockerhub-description@v5
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_PASSWORD }}
        repository: peterevans/dockerhub-description
        readme-filepath: ./path/to/README.md

Using the GitHub repository description

The GitHub repository description can be used for the Docker Hub short-descripton by passing the description from the event context.

yaml
    - name: Docker Hub Description
      uses: peter-evans/dockerhub-description@v5
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_PASSWORD }}
        repository: peterevans/dockerhub-description
        short-description: ${{ github.event.repository.description }}

Examples

The following workflow updates the Docker Hub repository description whenever there are changes to README.md and the workflow file itself on the main branch. This workflow assumes its location to be .github/workflows/dockerhub-description.yml.

…

Updates the Docker Hub repository description whenever a new release is created.

yaml
name: Update Docker Hub Description
on: release
jobs:
  dockerHubDescription:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - name: Docker Hub Description
      uses: peter-evans/dockerhub-description@v5
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_PASSWORD }}
        repository: peterevans/dockerhub-description
        short-description: ${{ github.event.repository.description }}

URL completion known Issues

The completion of relative URLs has some known issues:

  1. Relative markdown links in inline-code and code blocks are also converted:

    markdown
    [link in inline code](#table-of-content)

    will be converted into

    markdown
    [link in inline code](https://github.com/peter-evans/dockerhub-description/blob/main/./README.md#table-of-content)
  2. Links containing square brackets (]) in the text fragment are not converted:

    markdown
    [[link text with square brackets]](#table-of-content)
  3. Reference-style links/images are not converted.

    markdown
    [table-of-content][toc]
    
    ...
    
    [toc]: #table-of-content "Table of content"

Using the Docker image independently of GitHub Actions

The image can be executed in other environments independently of GitHub Actions. Simply volume mount the location of the README.md file to the container and set environment variables as follows.

bash
docker run -v $PWD:/workspace \
  -e DOCKERHUB_USERNAME='user1' \
  -e DOCKERHUB_PASSWORD='xxxxx' \
  -e DOCKERHUB_REPOSITORY='user1/my-docker-image' \
  -e README_FILEPATH='/workspace/README.md' \
  peterevans/dockerhub-description:3

License

MIT

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptdockerdockerhubdockerhub-descriptiongithub-action

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理