woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.2k stars 364 forks source link

Cannot pull custom docker image without full semver #2059

Closed lonix1 closed 1 year ago

lonix1 commented 1 year ago

Component

server

Describe the bug

My woodpecker.yml:

variables:
  - &PLUGIN_CUSTOM_1 gitea.example.com/my-org/my-repo:0         # fails: major
  - &PLUGIN_CUSTOM_2 gitea.example.com/my-org/my-repo:0.1       # fails: major.minor
  - &PLUGIN_CUSTOM_3 gitea.example.com/my-org/my-repo:0.1.1     # works: major.minor.patch
  - &PLUGIN_GIT woodpeckerci/plugin-git:2                       # works: major

clone:
  clone:
    image: *PLUGIN_GIT

steps:
  my-step-1:
    image: *PLUGIN_CUSTOM_1
  my-step-2:
    image: *PLUGIN_CUSTOM_2
  my-step-3:
    image: *PLUGIN_CUSTOM_3

For my-step-1 and my-step-2 I get:

Manifest unknown

It only works when I specify the full semver major.minor.patch format - I cannot specify only major. But for plugins from github and codeberg I can specify only major.

System Info

1.0.0-rc1
docker

Additional context

No response

Validations

ChewingBever commented 1 year ago

Does the registry actually contain gitea.example.com/my-org/my-repo:0 or gitea.example.com/my-org/my-repo:0.1? When you run docker pull gitea.example.com/my-org/my-repo:0, docker isn't going to parse that tag as semver and look for the newest version matching that major, it will literally just try to pull that exact tag.

If you want to be able to pull gitea.example.com/my-org/my-repo:0 and gitea.example.com/my-org/my-repo:0.1, you need to also publish your image under those two tags as well.

The reason you can pull woodpeckerci/plugin-git:2 is because it actually exists.

6543 commented 1 year ago

Can you point me to your dockerhub image?

lonix1 commented 1 year ago

docker isn't going to parse that tag as semver ... it will literally just try to pull that exact tag.

That was the issue... Thanks for that nuanced bit of docker wisdom, you are the boss!