Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 867
Cameron Avatar asked Jun 17 '19 17:06

Cameron


People also ask

What is an error 500 internal server error?

The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from fulfilling the request. This error is usually returned by the server when no other error code is suitable.

What is https Registry 1 Docker io?

"https://registry-1.docker.io"] # ... As for where registry-1.docker.io comes from, it's the DNS name for the Docker Hub registry, which is the default when you do not specify a registry in your image name. Follow this answer to receive notifications.

What is Docker Hub registry?

For information about Docker Hub, which offers a hosted registry with additional features such as teams, organizations, web hooks, automated builds, etc, see Docker Hub. A registry is a storage and content delivery system, holding named Docker images, available in different tagged versions.

What is internal server error 500?

The Internal Server Error 500 is a collective status code for server errors. Therefore, at first glance, it is not possible to determine where the error actually lies. The user only knows that the server has reported an unexpected error.

Why am I getting a 500 server error when pushing images?

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.

How do I find the source of HTTP error 500?

For Linux servers, the collection of error messages should be found at /var/log/httpd/error_log. It makes sense to reload the website to reproduce the HTTP error 500 code and observe how the log file is being created. This will help you find the source of the error quite quickly.

How to enable Docker push with insecure registry?

Add insecure-registry option in docker configuration and restart docker service. And then try docker push using machine-ip:5000 Check this out. Show activity on this post. If you set up a secure registry, you need to login to docker registry with something like this: You may need to use username:pass combo with curl.


3 Answers

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.

like image 191
wafers Avatar answered Oct 03 '22 06:10

wafers


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.

like image 37
ankit shukla Avatar answered Oct 03 '22 07:10

ankit shukla


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

like image 38
Alon Gouldman Avatar answered Oct 03 '22 07:10

Alon Gouldman