Docker Windows Local Registry: received unexpected HTTP status: 500 Internal Server Error

半世苍凉 提交于 2021-02-08 17:36:04

问题


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.


回答1:


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.




回答2:


To me the problem was that our registry was full. I emptied it and it worked.




回答3:


It could be because of an error on the remote server(or local server) where you want to push your image. In my case it was a disk space issue which was thrown as a 500 Server Error. The issue needs to be checked on the server where the image is being pushed.

All of your images were pushed except a few ones because all the others were already pushed and the ones which were new failed.



来源:https://stackoverflow.com/questions/56636181/docker-windows-local-registry-received-unexpected-http-status-500-internal-ser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!