Docker Windows本地注册表:接收到意外的HTTP状态:500内部服务器错误 [英] Docker Windows Local Registry: received unexpected HTTP status: 500 Internal Server Error

查看:131
本文介绍了Docker Windows本地注册表:接收到意外的HTTP状态:500内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将Windows容器的映像推送到Windows VM上具有其自己IP地址的本地"存储库中.

因此,当我在VM上创建注册表时,可以通过转到ipaddress:5000来查看本地计算机上的存储库列表.

但是,当我尝试将图像推送到注册表时,它显示了要推送的层,但是在底部,它表示收到了意外的HTTP状态:500 Internal Server Error.

当我切换到Linux容器时,这不是问题.我可以从注册表中进行推拉操作.

解决方案

您需要通过在守护程序配置JSON文件中设置" allow-nondistributable-artifacts "选项来允许不可分发的工件./p>

对于Linux:使用上述选项在/etc/docker/daemon.json

中创建或更新docker daemon JSON文件.

对于Windows:

  1. 右键单击系统任务栏中的 Docker 图标,然后选择设置
  2. 选择守护程序标签
  3. 启用高级选项(如果已禁用)
  4. 将选项 allow-nondistributable-artifacts 添加到JSON Like:

      {注册表镜像":[],不安全的注册表":[],调试":是的,实验性":是的,允许不可分配的工件":[本地主机:5000"]} 

  5. 用您自己的服务器名称替换 localhost .

  6. 或者, daemon.json 文件位于 C:\ ProgramData \ Docker \ config \ daemon.json

注意:如果您有其他设置,则仅 allow-nondistributable-artifacts 是重要/必需的.

I am attempting to push an image of a windows container to a "local" repository on a Windows VM, which has it's own IP address.

So when I create the registry on my VM, I can view the repository list on my local machine by going to the ipaddress:5000 just fine.

However, when I try to push an image to the registry it shows the layers to be pushed but at the bottom it says received unexpected HTTP status: 500 Internal Server Error.

This isn't a problem when I switch to Linux containers. I can push and pull from the registry no problem.

解决方案

You need to allow non distributable artifacts by setting the "allow-nondistributable-artifacts" option in the daemon configuration JSON file.

For Linux: Create or update the docker daemon JSON file with the above option at /etc/docker/daemon.json

For Windows:

  1. Right click on Docker icon in the system tray and select settings
  2. Select the Daemon tab
  3. Enable Advanced option (if disabled)
  4. Add the option allow-nondistributable-artifacts into the JSON Like:

    {
        "registry-mirrors": [],
        "insecure-registries": [],
        "debug": true,
        "experimental": true,
        "allow-nondistributable-artifacts": [
            "localhost:5000"
        ]
    }
    

  5. Replace localhost with the name of your own server name.

  6. Alternatively, the daemon.json file is located under C:\ProgramData\Docker\config\daemon.json

Note: If you have any other settings, ONLY allow-nondistributable-artifacts is important/required.

这篇关于Docker Windows本地注册表:接收到意外的HTTP状态:500内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆