Search code examples
dockerboot2dockerdocker-registry

Docker private registry - Method not allowed 405


I'm trying to create private registry for docker and I'm relying on instructions given on the docker site. I have a seperate linux box where this registry is installed, then I'm trying to push my images from local(osx box with docker toolbox). I keep on getting 405 from registry server. I'm quite new to docker. I was hoping the default basic configuration to work without much trouble.

configuration

Latest docker toolbox. Latest registry installation. I only changes the TLS configuration to post the request over http.

Error

    The push refers to a repository [192.168.1.98:5000/complete] (len: 1)
Sending image list
Error: Status 405 trying to push repository complete: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>405 Method Not Allowed</title>\n</head><body>\n<h1>Method Not Allowed</h1>\n<p>The requested method PUT is not allowed for the URL /v1/repositories/complete/.</p>\n</body></html>\n"

Solution

  • The doc mentions

    405 Method Not Allowed
    

    Manifest put is not allowed because the registry is configured as a pull-through cache or for some other reason

    (like a read-only mode)

    UNSUPPORTED: The operation was unsupported due to a missing implementation or invalid set of parameters.

    The same doc uses urls which include /v2, not like the one used in the question (/v1/repositories/complete)

    The instructions include:

    Getting the headers correct is very important. For all responses to any request under the “/v2/” url space, the Docker-Distribution-API-Version header should be set to the value “registry/2.0”, even for a 4xx response

    Make sure you are running a v2 registry image (which is now docker distribution)


    The OP Charith actually found in the comments:

    mistake in port forwarding on the registry host: The 5000 port was servicing from another server.
    I've switched to an available port and everything started working.