Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-15582

docker proxy repository does not work for container-registry.oracle.com

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.6.1, 3.9.0
    • Fix Version/s: 3.12.0
    • Component/s: Docker
    • Labels:
    • Story Points:
      1

      Description

      I am trying to proxy the oracle container registry, which requires a username/password. It seems there is an error in the callback during auth as it has a space in it.

      https://blogs.oracle.com/weblogicserver/the-oracle-container-registry-has-gone-live

      i get the following error;

       deploy org.sonatype.nexus.repository.docker.internal.V2Handlers - Error: GET /v2/java/serverjre/manifests/9.0.1
      java.lang.IllegalArgumentException: Illegal character in query at index 57: https://container-registry.oracle.com/auth?service=Oracle Registry&scope=repository:java/serverjre:pull
          at java.net.URI.create(URI.java:852)
          at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:69)
          at org.sonatype.nexus.repository.docker.internal.DockerProxyFacetImpl.retrieveBearerToken(DockerProxyFacetImpl.java:431)
          at org.sonatype.nexus.repository.docker.internal.DockerProxyFacetImpl.access$3(DockerProxyFacetImpl.java:424)
          at org.sonatype.nexus.repository.docker.internal.DockerProxyFacetImpl$2.retrieveBearerToken(DockerProxyFacetImpl.java:782)
          at org.sonatype.nexus.repository.docker.internal.auth.DockerAuthHttpClientContext$2.getToken(DockerAuthHttpClientContext.java:76)
          at org.sonatype.nexus.repository.docker.internal.auth.BearerScheme.authenticate(BearerScheme.java:104)
      

      Cause

      In DockerProxyFacetImpl.retrieveBearerToken we do

      HttpGet request = new HttpGet(realm + "?service=" + service + "&scope=" + scope);
      

      The URL is not properly encoded.

      Reproduce

      1. Sign up at https://container-registry.oracle.com
      2. Create a Docker proxy against that (with authentication)
      3. pull something with docker against this repo. ie. docker pull localhost:12344/database/enterprise:12.2.0.1

        Attachments

          Activity

            People

            • Assignee:
              mdodgson Mark Dodgson
              Reporter:
              acraft Andrew Craft
              Last Updated By:
              Joseph Stephens
              Team:
              Nexus - Formats
            • Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: