编程技术网

关注微信公众号,定时推送前沿、专业、深度的编程技术资料。

 找回密码
 立即注册

QQ登录

只需一步,快速开始

极客时间

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

vignesh0710 云计算 2022-5-10 14:48 8人围观

腾讯云服务器
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内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程技术网(www.editcode.net)!

腾讯云服务器 阿里云服务器
关注微信
^