You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用公共Docker Registry容器构建GitHub Action报错求助

问题:使用Docker Hub公共容器创建GitHub Docker Action失败

场景说明

  • 尝试创建不依赖本地Dockerfile、直接使用Docker Hub公共容器的简单Docker Action
  • 创建了两个GitHub仓库:
    • docker-creator:用于存放Docker Action的配置文件
    • docker-user:作为调用该Docker Action的任务仓库

docker-creator仓库的action.yml配置

name: 'Hello World'
description: 'Greet someone and record the time'
inputs:
  who-to-greet:  # id of input
    description: 'Who to greet'
    required: true
    default: 'World'
outputs:
  time: # id of output
    description: 'The time we greeted you'
runs:
  using: 'docker'
  image: 'docker://alpine:3.10'
  args:
    - ${{ inputs.who-to-greet }}

说明:常规Docker Action的image参数通常指向本地Dockerfile,此处替换为Docker Hub的公共容器地址

docker-user仓库的调用工作流配置(main.yml)

hello_world_job:
  runs-on: ubuntu-latest
  name: A job to say hello
  steps:
    - name: Hello world action step
      id: hello
      uses: bryanaexp/docker-creator@main
      with:
        who-to-greet: 'Cat'
    # 使用hello步骤的输出结果
    - name: Get the output time
      run: echo "The time was ${{ steps.hello.outputs.time }}"

问题现象

从docker-user仓库调用docker-creator的Action时出现错误

已尝试的解决方式

  • 查阅GitHub Action官方文档及相关示例
  • 测试多种参数配置组合
  • 在Stack Overflow搜索相关内容,但找到的案例大多基于本地Dockerfile,仅找到私有Docker Registry的类似场景示例,问题仍未解决

内容的提问来源于stack exchange,提问作者Black-Bryan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.12 03:50:45