Git Product home page Git Product logo

Comments (11)

twbworld avatar twbworld commented on June 26, 2024

我是作者

from twbworld.github.io.

horaoen avatar horaoen commented on June 26, 2024

你是我的救星

from twbworld.github.io.

lanyucomputer avatar lanyucomputer commented on June 26, 2024

name: ci
on:
workflow_dispatch: #github页面手动触发
push:
tags:
- "v*."
env:
IMAGE_NAME: test #这是您的镜像名
jobs:
get-tags:
runs-on: ubuntu-20.04
env:
TZ: Asia/Shanghai
outputs:
tags: ${{ steps.set-output-id.outputs.tags }}
steps:
- uses: actions/checkout@v2
- name: set-output
id: set-output-id
run: |
VERSION=edge
if [[ $GITHUB_REF == refs/tags/
]]; then
VERSION=${GITHUB_REF#refs/tags/v}
fi
echo ::set-output name=tags::${VERSION}
push-ghcr:
runs-on: ubuntu-20.04
env:
TZ: Asia/Shanghai
REGISTRY: ghcr.io
steps:
- uses: actions/checkout@v2
- name: Login
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.PACKAGES_TOKEN }}
- name: Build && Push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ needs.get-tags.outputs.tags }}
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest

from twbworld.github.io.

lanyucomputer avatar lanyucomputer commented on June 26, 2024

0s
Run docker/login-action@v1
Logging into ghcr.io...
Login Succeeded!
0s
Run docker/build-push-action@v2
Docker info
/usr/bin/docker buildx build --file ./Dockerfile --iidfile /tmp/docker-build-push-5JnPya/iidfile --tag ghcr.io/lanyucomputer/openwrt_s912_zyxq_R22.4.1_k5.15.34-flippy-71+o.img.gz: --tag ghcr.io/lanyucomputer/openwrt_s912_zyxq_R22.4.1_k5.15.34-flippy-71+o.img.gz:latest --metadata-file /tmp/docker-build-push-5JnPya/metadata-file --push .
error: invalid tag "ghcr.io/lanyucomputer/openwrt_s912_zyxq_R22.4.1_k5.15.34-flippy-71+o.img.gz:": invalid reference format
Error: buildx failed with: error: invalid tag "ghcr.io/lanyucomputer/openwrt_s912_zyxq_R22.4.1_k5.15.34-flippy-71+o.img.gz:": invalid reference format

from twbworld.github.io.

lanyucomputer avatar lanyucomputer commented on June 26, 2024

Run docker/build-push-action@v2
Docker info
/usr/bin/docker buildx build --file ./Dockerfile --iidfile /tmp/docker-build-push-t5PG5d/iidfile --tag ghcr.io/lanyucomputer/OpenWrt2022: --tag ghcr.io/lanyucomputer/OpenWrt2022:latest --metadata-file /tmp/docker-build-push-t5PG5d/metadata-file --push .
error: invalid tag "ghcr.io/lanyucomputer/OpenWrt2022:": invalid reference format
Error: buildx failed with: error: invalid tag "ghcr.io/lanyucomputer/OpenWrt2022:": invalid reference format

from twbworld.github.io.

lanyucomputer avatar lanyucomputer commented on June 26, 2024

换成库的名字也是这个提示,说TAG的格式不对,但脚 本是完全复制上面的

from twbworld.github.io.

twbworld avatar twbworld commented on June 26, 2024

换成库的名字也是这个提示,说TAG的格式不对,但脚 本是完全复制上面的

我猜测应该是ghcr.io不支持您所使用的名称,您试下在git使用简单点的名称打tag, 如"V1.0.1"

from twbworld.github.io.

lanyucomputer avatar lanyucomputer commented on June 26, 2024

感谢你的回复,我的地址库改成OpenWrt2022 也是一样的提示,原码地址https://github.com/lanyucomputer/OpenWrt2022在这里,可以帮忙看一下吗,还是报错,docker-compose.yml
是这个文件

from twbworld.github.io.

lanyucomputer avatar lanyucomputer commented on June 26, 2024

@twbworld

换成库的名字也是这个提示,说TAG的格式不对,但脚 本是完全复制上面的

我猜测应该是ghcr.io不支持您所使用的名称,您试下在git使用简单点的名称打tag, 如"V1.0.1"

感谢你的回复,我的地址库改成OpenWrt2022 也是一样的提示,原码地址https://github.com/lanyucomputer/OpenWrt2022在这里,可以帮忙看一下吗,还是报错,docker-compose.yml
是这个文件

from twbworld.github.io.

twbworld avatar twbworld commented on June 26, 2024
on:
  workflow_dispatch:
  push:
    tags:
      - "v*.*"

跟你的地址库没关, 要使用git打上一个tag,名称的格式为"v*.*",如"v1.0.1",它才会打包

或者把"${{ needs.get-tags.outputs.tags }}"写死,改为你自定义的名称

from twbworld.github.io.

lanyucomputer avatar lanyucomputer commented on June 26, 2024

写死为:lastest后报错如下
error: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount187581008/Dockerfile: no such file or directory
Error: buildx failed with: error: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount187581008/Dockerfile: no such file or directory

from twbworld.github.io.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.