Docker error: invalid reference format: repository name must be lowercase

前端 未结 22 2108
孤独总比滥情好
孤独总比滥情好 2020-12-12 23:07

Ran into this Docker error with one of my projects:

invalid reference format: repository name must be lowercase

What are the various causes for

22条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 23:51

    Indeed, the docker registry as of today (sha 2e2f252f3c88679f1207d87d57c07af6819a1a17e22573bcef32804122d2f305) does not handle paths containing upper-case characters. This is obviously a poor design choice, probably due to wanting to maintain compatible with certain operating systems that do not distinguish case at the file level (ie, windows).

    If one authenticates for a scope and tries to fetch a non-existing repository with all lowercase, the output is

    (auth step not shown)
    curl -s -H "Authorization: Bearer $TOKEN" -X GET https://$LOCALREGISTRY/v2/test/someproject/tags/list
    {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Class":"","Name":"test/someproject","Action":"pull"}]}]}
    

    However, if one tries to do this with an uppercase component, only 404 is returned:

    (authorization step done but not shown here)
    $ curl -s -H "Authorization: Bearer $TOKEN" -X GET https://docker.uibk.ac.at:443/v2/test/Someproject/tags/list
    
    404 page not found
    

提交回复
热议问题