问题
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:
- Right click on Docker icon in the system tray and select settings
- Select the Daemon tab
- Enable Advanced option (if disabled)
Add the option
allow-nondistributable-artifacts
into the JSON Like:{ "registry-mirrors": [], "insecure-registries": [], "debug": true, "experimental": true, "allow-nondistributable-artifacts": [ "localhost:5000" ] }
Replace
localhost
with the name of your own server name.- Alternatively, the
daemon.json
file is located underC:\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