V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Rebron1900
V2EX  ›  GitHub

Github Action 生成 Docker 失败。

  •  
  •   Rebron1900 · 119 天前 · 964 次点击
    这是一个创建于 119 天前的主题,其中的信息可能已经有所发展或是发生改变。

    各位大佬们晚上好,因为在用的一个项目作者不接受 pr ,无奈只能自己修改,但是发现卡在发布 Docker 这一步,能帮我看看是怎么回事吗?

    Action 日志地址: https://github.com/rebron1900/yarr/actions/runs/7364702258/job/20045334141

    错误信息

    /usr/bin/docker buildx build --iidfile /tmp/docker-build-push-Yx82f1/iidfile --platform linux/amd64,linux/arm64,linux/arm/v7 --tag ***/yarr:latest --tag ***/yarr:v2.5 --metadata-file /tmp/docker-build-push-Yx82f1/metadata-file --push .
    #0 building with "builder-dd8b3058-a7fa-457b-a92a-cc56c9c1b5e0" instance using docker-container driver
    
    #1 [internal] load build definition from Dockerfile
    #1 transferring dockerfile: 2B done
    #1 DONE 0.0s
    ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory
    Error: buildx failed with: ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory
    
    12 条回复    2024-01-01 00:45:10 +08:00
    kassadin
        1
    kassadin  
       119 天前
    no such file or directory
    Dockerfile 的路径
    Rebron1900
        2
    Rebron1900  
    OP
       119 天前 via Android
    这个 action 我是从其他项目里复制出来的,不太懂他的运行逻辑
    Mogeko
        3
    Mogeko  
       119 天前 via iPhone
    docker/build-push-action@v2 加上

    with:
    file: etc/dockerfile
    Georgehu
        4
    Georgehu  
       119 天前
    Rebron1900
        5
    Rebron1900  
    OP
       118 天前
    @Georgehu 我试试,谢谢大佬。另外我好奇的是,整个 action 我复制自 https://github.com/arsfeld/yarr-build 这个项目,他里面就没有写./etc/dockerfile 这个设置,为啥他可以我不行...
    mulu
        6
    mulu  
       118 天前 via Android
    @Rebron1900 默认使用当前工作路径下的 dockerfile 文件,你 fork 的那个项目 master 分支的 dockerfile 文件放在 etc 文件夹下。
    tag 的 dockerfile 文件放在根目录。
    而你拷贝的那个 yarr-build 编译的不是 master 分支,是 tag 。
    https://github.com/nkanaev/yarr/tree/v2.4
    ```
    name: Checkout
    uses: actions/checkout@v2
    with:
    repository: 'nkanaev/yarr'
    ref: ${{ steps.read-tag.outputs.tag }}
    ```
    Rebron1900
        7
    Rebron1900  
    OP
       118 天前
    @mulu 懂了,谢谢大佬指点。
    Rebron1900
        8
    Rebron1900  
    OP
       118 天前
    @mulu 大佬我看了一下他的 tag ,好像确实和 master 分支有不一样的文件结构,他这个是怎么做到的呢?我对这方面完全没有经验,可以加个 wx 号咨询一下你吗?
    arloor
        9
    arloor  
       118 天前 via Android
    楼上大佬强
    另外 op 可以看下 github action 的文档系统了解下,github action 这个工具挺可以的
    mulu
        10
    mulu  
       118 天前 via Android   ❤️ 1
    @Rebron1900 额,他这个仓库最新的发版 tag 是几个月前,然后他两个月前有个 commit 修改了 dockerfile 位置。看他 commit 历史记录就好。
    https://github.com/nkanaev/yarr/commit/d787060a24ddb690d67405c7f08dba9a7c578fe1
    Rebron1900
        11
    Rebron1900  
    OP
       118 天前 via Android
    @mulu 我这也太蠢了
    Rebron1900
        12
    Rebron1900  
    OP
       118 天前
    @mulu 谢谢大佬,已经成功执行了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   893 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 22:01 · PVG 06:01 · LAX 15:01 · JFK 18:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.