【问题标题】:podman: Error: failed to parse "X-Registry-Auth" headerpodman:错误:无法解析“X-Registry-Auth”标头
【发布时间】:2021-11-06 08:05:55
【问题描述】:

我第一次尝试使用podman(在Mac OS 下使用podman machine,但这可能无关紧要)。当我尝试启动busybox图像作为测试时,like described in Introduction:

podman run -it docker.io/library/busybox

我收到以下错误:

Error: failed to parse "X-Registry-Auth" header for /v3.3.1/libpod/images/pull?alltags=false&arch=&authfile=&os=&password=&policy=missing&quiet=false&reference=docker.io%2Flibrary%2Fbusybox&username=&variant=: error storing credentials in temporary auth file (server: "https://index.docker.io/v1/", user: ""): key https://index.docker.io/v1/ contains http[s]:// prefix

(podman 版本 3.3.1)

【问题讨论】:

    标签: podman


    【解决方案1】:

    原因是我有 Docker Desktop 创建的 ~/.docker/config.json 文件。它有 docker.io 注册表的空条目,没有凭据,这是导致此错误的原因。

    由于该文件没有有价值的配置(主要是默认值),我将其删除,问题不再发生。

    % podman run -it docker.io/library/busybox
    Trying to pull docker.io/library/busybox:latest...
    Getting image source signatures
    Copying blob sha256:8ec32b265e94aafb0d43ab71f1d8f786122c19afb37d25532aea169f414f8881
    Copying blob sha256:8ec32b265e94aafb0d43ab71f1d8f786122c19afb37d25532aea169f414f8881
    Copying config sha256:42b97d3c2ae95232263a04324aaf656dc80e7792dee6629a9eff276cdfb806c0
    Writing manifest to image destination
    Storing signatures
    / #
    

    【讨论】:

    • 此解决方案有效。我首先有 docker 桌面 (osx),但无法使 podman pull 工作,而 podman login 工作完美。
    • 我还必须删除~/.dockercfg
    【解决方案2】:

    编辑~/.docker/config.json 文件并删除https://

    之前的配置(不工作)

    {
    {
      "credsStore" : "desktop",
      "auths" : {
        "https://index.docker.io/v1/" : {
    
        },
        "xxx-yyy-docker.artifactory.zzzz.com" : {
    
        },
        "registry.gitlab.zzzz.com" : {
    
        }
      },
      "credHelpers" : {
        "gcr.io" : "gcloud",
        "europe-west1-docker.pkg.dev" : "gcloud"
      }
    }
    

    之后(工作正常)

    {
    {
      "credsStore" : "desktop",
      "auths" : {
        "index.docker.io/v1/" : {
    
        },
        "xxx-yyy-docker.artifactory.zzzz.com" : {
    
        },
        "registry.gitlab.zzzz.com" : {
    
        }
      },
      "credHelpers" : {
        "gcr.io" : "gcloud",
        "europe-west1-docker.pkg.dev" : "gcloud"
      }
    }
    
    猜你喜欢
    • 1970-01-01
    • 2012-05-30
    • 2015-10-12
    • 2022-11-11
    • 2021-01-30
    • 1970-01-01
    • 2018-07-20
    • 2021-04-04
    • 1970-01-01
    相关资源
    最近更新 更多