sealer icon indicating copy to clipboard operation
sealer copied to clipboard

when sealer build save domain docker.io image error: get repository name error: invalid reference format

Open jelly320 opened this issue 3 years ago • 3 comments

What happen?

What happened:

我在尝试Build application image Kubevela时出现了以下报错 imageList

oamdev/alpine-k8s:1.18.2
oamdev/cluster-gateway:v1.4.0
oamdev/hello-world:v1
oamdev/kube-webhook-certgen:v2.4.1
oamdev/vela-core:v1.4.5

build执行

# sealer build -t kubevela-app:v1.4.5 --base=false  .

Relevant log output?

出现报错如下:

Error: save domain docker.io image error: get repository name error: invalid reference format
Usage:
  sealer build [flags] PATH

Examples:
the current path is the context path, default build type is lite and use build cache

build:
        sealer build -f Kubefile -t my-kubernetes:1.19.8 .

build without cache:
        sealer build -f Kubefile -t my-kubernetes:1.19.8 --no-cache .

build without base:
        sealer build -f Kubefile -t my-kubernetes:1.19.8 --base=false .

build with args:
        sealer build -f Kubefile -t my-kubernetes:1.19.8 --build-arg MY_ARG=abc,PASSWORD=Sealer123 .



Flags:
      --base                build with base image,default value is true. (default true)
      --build-arg strings   set custom build args
  -h, --help                help for build
  -t, --imageName string    cluster image name
  -f, --kubefile string     kubefile filepath (default "Kubefile")
  -m, --mode string         cluster image build type, default is lite (default "lite")
      --no-cache            build without cache
      --platform string     set cloud image platform,if not set,keep same platform with runtime

Global Flags:
      --config string   config file (default is $HOME/.sealer.json)
  -d, --debug           turn on debug mode
      --hide-path       hide the log path
      --hide-time       hide the log time

save domain docker.io image error: get repository name error: invalid reference format

debug时候偶现pull docker.io/library/_params.image:latest时的报错:

save domain docker.io image error: get library/parameter.image tag descriptor error: unknown tag=latest, try "docker login" if you are using a private registry

What you expected to happen?

How to reproduce it (as minimally and precisely as possible)?

Kubefile

FROM kubernetes:v1.22.8

#images pull before cluster build
COPY imageList manifests
#helm

# install kubevela command
COPY kubectl-vela-v1.4.5-linux-amd64.tar.gz .
CMD tar zxvf kubectl-vela-v1.4.5-linux-amd64.tar.gz && cp linux-amd64/kubectl-vela /usr/local/bin/vela && chmod +x /usr/local/bin/vela 

# install kubevela core
COPY vela-core charts
CMD  helm install --create-namespace -n vela-system kubevela charts/vela-core --wait

# install velaUX
CMD /usr/local/bin/vela addon enable velaux --version=v1.4.5 serviceType=NodePort

Anything else we need to know?

What is the version of Sealer you using?

{"gitVersion":"v0.8.5","gitCommit":"f9c3d99","buildDate":"2022-04-28 14:16:58","goVersion":"go1.16.15","compiler":"gc","platform":"linux/amd64"}

What is your OS environment?

CentOS Linux 7 (Core)

What is the Kernel version?

3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Other environment you want to tell us?

  • Cloud provider or hardware configuration:
  • Install tools:
  • Others:

jelly320 avatar Jul 05 '22 09:07 jelly320

@jelly320 , Does this image library/parameter.image defined in your chart package vela-core?

kakaZhou719 avatar Jul 05 '22 09:07 kakaZhou719

@jelly320 , Does this image library/parameter.image defined in your chart package vela-core?

parameter.image出现在vela-core/templates的yaml文件中

vela-core为kubevela提供的chart。Kubefile中使用helm时,是否是识别了所有的image:来当成包下载 ?我们看到vela-core/templates下的image: 在build的过程中都有被下载。

# grep "image: parameter.image" * -r
templates/defwithtemplate/cron-task.yaml:                                                               image: parameter.image
templates/defwithtemplate/init-container.yaml:                  image: parameter.image
templates/defwithtemplate/nocalhost.yaml:                                                       image: parameter.image
templates/defwithtemplate/sidecar.yaml:                 image: parameter.image
templates/defwithtemplate/task.yaml:                                            image: parameter.image
templates/defwithtemplate/webservice.yaml:                                              image: parameter.image
templates/defwithtemplate/worker.yaml:                                          image: parameter.image
# grep "image: string" * -r
templates/addon/fluxcd-def.yaml:                url\n    image: string\n    // +usage=The name of the secret containing
templates/defwithtemplate/container-image.yaml:         image: string
templates/defwithtemplate/cron-task.yaml:               image: string
templates/defwithtemplate/init-container.yaml:          image: string
templates/defwithtemplate/sidecar.yaml:         image: string
templates/defwithtemplate/task.yaml:            image: string
templates/defwithtemplate/webservice.yaml:              image: string
templates/defwithtemplate/worker.yaml:          image: string

jelly320 avatar Jul 05 '22 13:07 jelly320

@jelly320 , Does this image library/parameter.image defined in your chart package vela-core?

parameter.image出现在vela-core/templates的yaml文件中

vela-core为kubevela提供的chart。Kubefile中使用helm时,是否是识别了所有的image:来当成包下载 ?我们看到vela-core/templates下的image: 在build的过程中都有被下载。

# grep "image: parameter.image" * -r
templates/defwithtemplate/cron-task.yaml:                                                               image: parameter.image
templates/defwithtemplate/init-container.yaml:                  image: parameter.image
templates/defwithtemplate/nocalhost.yaml:                                                       image: parameter.image
templates/defwithtemplate/sidecar.yaml:                 image: parameter.image
templates/defwithtemplate/task.yaml:                                            image: parameter.image
templates/defwithtemplate/webservice.yaml:                                              image: parameter.image
templates/defwithtemplate/worker.yaml:                                          image: parameter.image
# grep "image: string" * -r
templates/addon/fluxcd-def.yaml:                url\n    image: string\n    // +usage=The name of the secret containing
templates/defwithtemplate/container-image.yaml:         image: string
templates/defwithtemplate/cron-task.yaml:               image: string
templates/defwithtemplate/init-container.yaml:          image: string
templates/defwithtemplate/sidecar.yaml:         image: string
templates/defwithtemplate/task.yaml:            image: string
templates/defwithtemplate/webservice.yaml:              image: string
templates/defwithtemplate/worker.yaml:          image: string

we use helm engine to render the charts package, but why sealer find the wrong image name from templates that is not make sense. i will try to investigate it.

kakaZhou719 avatar Jul 07 '22 02:07 kakaZhou719