snowdreamtech / base

Docker Image packaging for Base. (amd64, arm32v5, arm32v6, arm32v7, arm64v8, i386, mips64le, ppc64le,riscv64, s390x)
MIT License
1 stars 0 forks source link

generate wrong tag: snowdreamtech/frpc:alpine3.20- #1

Closed snowdream closed 2 hours ago

snowdream commented 2 hours ago

Contributing guidelines

I've found a bug, and:

Description

image: snowdreamtech/frpc

            type=raw,enable={{is_default_branch}},priority=200,prefix=,suffix=,value=alpine3.20⁠

Expected behaviour

generate right tag: snowdreamtech/frpc:alpine3.20

Actual behaviour

generate wrong tag: snowdreamtech/frpc:alpine3.20-

Repository URL

https://github.com/snowdreamtech/frp

Workflow run URL

https://github.com/snowdreamtech/frp/actions/runs/10937634281/job/30363937723

YAML workflow

short:

            type=raw,enable={{is_default_branch}},priority=200,prefix=,suffix=,value=alpine3.20⁠

long:

     - name: Docker meta
        id: meta
        uses: docker/metadata-action@v5.5.1
        with:
          images: |
            name=snowdreamtech/frpc,enable=true
            name=ghcr.io/snowdreamtech/frpc,enable=true
          flavor: |
            latest=false  
            prefix=
            suffix=
          tags: |
            type=edge,enable=true,priority=700,prefix=,suffix=,branch=dev
            type=raw,enable={{is_default_branch}},priority=200,prefix=,suffix=,value=latest
            type=raw,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=200,prefix=,suffix=,value=latest
            type=pep440,enable=true,priority=900,prefix=,suffix=,pattern={{version}}
            type=pep440,enable=true,priority=900,prefix=,suffix=,pattern={{major}}.{{minor}}
            type=pep440,enable=${{ !startsWith(github.ref, 'refs/tags/v0.') && !startsWith(github.ref, 'refs/tags/0.') }},priority=900,prefix=,suffix=,pattern={{major}}
            type=edge,enable=true,priority=700,prefix=,suffix=-alpine,branch=dev
            type=raw,enable={{is_default_branch}},priority=200,prefix=,suffix=,value=alpine
            type=raw,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=200,prefix=,suffix=,value=alpine
            type=pep440,enable=true,priority=900,prefix=,suffix=-alpine,pattern={{version}}
            type=pep440,enable=true,priority=900,prefix=,suffix=-alpine,pattern={{major}}.{{minor}}
            type=pep440,enable=${{ !startsWith(github.ref, 'refs/tags/v0.') && !startsWith(github.ref, 'refs/tags/0.') }},priority=900,prefix=,suffix=-alpine,pattern={{major}}
            type=edge,enable=true,priority=700,prefix=,suffix=-alpine3.20⁠,branch=dev
            type=raw,enable={{is_default_branch}},priority=200,prefix=,suffix=,value=alpine3.20⁠
            type=raw,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=200,prefix=,suffix=,value=alpine3.20⁠
            type=pep440,enable=true,priority=900,prefix=,suffix=-alpine3.20⁠,pattern={{version}}
            type=pep440,enable=true,priority=900,prefix=,suffix=-alpine3.20⁠,pattern={{major}}.{{minor}}
            type=pep440,enable=${{ !startsWith(github.ref, 'refs/tags/v0.') && !startsWith(github.ref, 'refs/tags/0.') }},priority=900,prefix=,suffix=-alpine3.20⁠,pattern={{major}}
        env:
          DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index


### Workflow logs

[logs_28582096259.zip](https://github.com/user-attachments/files/17056503/logs_28582096259.zip)

https://github.com/snowdreamtech/frp/actions/runs/10937634281/job/30363937723

### BuildKit logs

_No response_

### Additional info

_No response_
snowdream commented 2 hours ago

docker images:

https://github.com/snowdreamtech/frp/pkgs/container/frpc

https://hub.docker.com/r/snowdreamtech/frpc/tags

snowdream commented 2 hours ago

when i open the file with vim, i find the invalid characters:

image

To ease the integration in your workflow, this action will automatically:

Lowercase the image name
Replace invalid chars sequences with - for tags
snowdream commented 2 hours ago

To remove invisible or invalid characters from a file in a shell environment, you can use several commands. Here are a couple of effective methods:

Using tr Command

The tr command can be used to remove non-printable ASCII characters:

tr -cd '\11\12\15\40-\176' < input-file > clean-file

This command keeps only the tab, linefeed, carriage return, and printable characters, removing all others².

Using iconv Command

The iconv command can convert text from one encoding to another and can be used to remove invalid characters:

iconv -f utf-8 -t utf-8 -c input-file > clean-file

The -c option tells iconv to omit invalid characters from the output¹.

Using grep Command

To find and remove non-UTF-8 characters, you can use grep:

grep -axv '.*' input-file > clean-file

This command finds lines with invalid UTF-8 characters and removes them¹.

These methods should help you clean up your files by removing any unwanted invisible or invalid characters. If you have a specific scenario or file type in mind, let me know, and I can provide more tailored advice!

源: 与 Copilot 的对话, 2024/9/20 (1) Remove non-printable ASCII characters from a file with this Unix command. https://alvinalexander.com/blog/post/linux-unix/how-remove-non-printable-ascii-characters-file-unix/. (2) How to Remove Non UTF-8 Characters From a File - Baeldung. https://www.baeldung.com/linux/remove-non-utf-8-characters. (3) Remove non-printable ASCII characters from a file with this Unix command. https://bing.com/search?q=shell+command+to+remove+invisible+invalid+characters. (4) undefined. http://www.asciitable.com/. (5) undefined. http://www.csc.villanova.edu/~tway/resources/ascii-table.html.