Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add standard OCI container metadata labels to Dockerfile and CI workflows

未关闭 适合新手
#919 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
70/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
docker, github-actions
领域
ci-cd, devops

调研方向

从 Dockerfile 的最终运行时阶段开始,即基于 mcr.microsoft.com/dotnet/aspnet:10.0 的那个阶段,在其中添加 org.opencontainers.image.* 的 LABEL 行。然后查看 .github/workflows/docker-image.yml 中的 build-and-push 步骤,以及 .github/workflows/docker-ghcr.yml 中的 labels 块,扩展现有标签或改用 docker/metadata-action。当镜像带有标准标签且工作流会发布这些标签时即完成,可以对本地构建的镜像使用 docker inspect 进行检查。

由索引模型根据 Issue 内容生成。

描述

enhancement
The problem

Currently, GrandNode container images are missing standard Open Container Initiative (OCI) image specification labels:

  • In Dockerfile, the final runtime image stage (mcr.microsoft.com/dotnet/aspnet:10.0) contains no metadata labels.
  • In .github/workflows/docker-image.yml, the build-and-push step sends no labels to Docker Hub.
  • In .github/workflows/docker-ghcr.yml, only a partial set of labels (source, version, revision, description) is provided, omitting standard fields like title, url, vendor, and licenses.

As a result:

  1. Registries (such as Docker Hub and GitHub Container Registry) do not display standard project metadata, vendor information, or direct links to documentation.
  2. Container vulnerability scanners (e.g., Trivy, Grype, Snyk) and cluster auditing tools cannot inspect standardized license (GPL-3.0) or provenance metadata from the container image manifest.
Proposed solution

Add standard OCI image annotations (org.opencontainers.image.*) following the OCI Image Specification:

  1. In Dockerfile (runtime stage):
LABEL org.opencontainers.image.title="GrandNode" \
      org.opencontainers.image.description="GrandNode e-commerce platform" \
      org.opencontainers.image.url="https://grandnode.com" \
      org.opencontainers.image.documentation="https://docs.grandnode.com" \
      org.opencontainers.image.source="https://github.com/grandnode/grandnode2" \
      org.opencontainers.image.vendor="GrandNode" \
      org.opencontainers.image.licenses="GPL-3.0"
  1. In CI Workflows (.github/workflows/docker-image.yml and .github/workflows/docker-ghcr.yml): Attach dynamic build metadata (revision, version, created) when publishing, or leverage docker/metadata-action to generate standard OCI tags and labels consistently across registries.
Contribution
  • I would like to submit a pull request for this.
主要语言
C#
星标
1.3k
派生
549
平均合并
13 小时 1 分钟
30 天内合并 PR
65

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

grandnode/grandnode2 的其他 Issue

查看 grandnode/grandnode2 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。