Kaniko问题集锦

发布时间 2023-12-11 17:02:20作者: dongzhiwei-blog

遇到的问题

  1. 知道用户名和密码,无法登录镜像仓库
    解决方案:生成认证文件比如
{
  "auths": {
    "https://your-registry.example.com": {
    "auth": "base64-encoded-auth-string"
    }
  }
}

挂载进/kaniko/.docker/
  1. error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "base-registry.com/test/nginx:v1": POST https://base-registry.com/v2/devops/jdk8/blobs/uploads/: UNAUTHORIZED: unauthorized to access repository: devops/jdk8, action: push: unauthorized to access repository: devops/jdk8, action: push
    解决方案:挂载 -v /root/.docker/ /kaniko/.docker/

  2. error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "base-registry.com/test/nginx:v1": creating push check transport for base-registry.zhonganinfo.com failed: Get "https://base-registry.com/v2/": tls: failed to verify certificate: x509: certificate signed by unknown authority
    解决方案:添加参数--skip-tls-verify[2]

  3. error building image: error building stage: failed to get filesystem from image: error calling stat on /var/spool/mail.: stat /var/spool/mail: too many levels of symbolic links
    解决方案:添加参数--ignore-path=/var