Can't login to Docker Registry with configured authentication



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















  • I've been trying to install Docker registry with basic auth.

It should be connected to a gitlab,latest version-
CentOS Linux release 7.5.1804, 3.10.0-862.14.4.el7.x86_64.
Docker version: 17.05.0-ce, API version: 1.29



  • Server set up for Registry is:
    AWS CentOS 6.9, 4.14.77-69.57.amzn1.x86_64.
    Docker version: 18.06.1-ce, API version: 1.38

  • Docker is on V2 (Both registry and gitlab)

This works flawlessly:



docker run -d -p 1300:5000 --restart=always --name registry -v /opt/ssl:/opt/ssl -e REGISTRY_HTTP_TLS_CERTIFICATE=/opt/ssl/CERT.crt -e REGISTRY_HTTP_TLS_KEY=/opt/ssl/SRV_KEY.key registry:2


I am able to push, remove and view the images on the web with



https://example.com:1300/v2/_catalog


This is where things starting to get complicated,
I am trying to implement basic Auth onto the registry:



Initially i ran docker run --entrypoint htpasswd registry:2 -Bbn USER PASSWORD > /opt/auth/htpasswd



(Side note, using .htpasswd failed, but using htpasswd worked- Why? why can't i use a hidden file ? docker can't find it although it is actually running with root?)



Then I ran docker run -d -p 1300:5000 --restart=always --name registry -v /opt/ssl:/opt/ssl -e REGISTRY_HTTP_TLS_CERTIFICATE=/opt/ssl/CERT.crt -e REGISTRY_HTTP_TLS_KEY=/opt/ssl/SRV_KEY.key -v /opt/auth:/opt/auth -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/opt/auth/htpasswd registry:2



(no-auth version of registry was removed off course, also some places suggest to use pwd at the respected location after the -e flag, but that didn't worked- container starts in restarting loop that never ends)



Now, I can login via web to the registry, (Which I assume proves that the auth process works, ?) but the page is blank. dev tools shows http response 200 for the domain, but I get http response 400 for all else.



When trying to login via cli to the registry using:



docker login --username username example.com:1300
||



docker login --username username https://example.com:1300



I get connection refused.



  • ALL ports are open.

  • password was accepts by the web, so the mechanism is surely working..

  • I checked file permission, all was made by root, so who it is not accessible?

  • service and container are working and up.

Many sites states that the process I used works, (even on SO) but no real answer on why it is not working.



Any assistance would be most helpful.










share|improve this question




























    0















    • I've been trying to install Docker registry with basic auth.

    It should be connected to a gitlab,latest version-
    CentOS Linux release 7.5.1804, 3.10.0-862.14.4.el7.x86_64.
    Docker version: 17.05.0-ce, API version: 1.29



    • Server set up for Registry is:
      AWS CentOS 6.9, 4.14.77-69.57.amzn1.x86_64.
      Docker version: 18.06.1-ce, API version: 1.38

    • Docker is on V2 (Both registry and gitlab)

    This works flawlessly:



    docker run -d -p 1300:5000 --restart=always --name registry -v /opt/ssl:/opt/ssl -e REGISTRY_HTTP_TLS_CERTIFICATE=/opt/ssl/CERT.crt -e REGISTRY_HTTP_TLS_KEY=/opt/ssl/SRV_KEY.key registry:2


    I am able to push, remove and view the images on the web with



    https://example.com:1300/v2/_catalog


    This is where things starting to get complicated,
    I am trying to implement basic Auth onto the registry:



    Initially i ran docker run --entrypoint htpasswd registry:2 -Bbn USER PASSWORD > /opt/auth/htpasswd



    (Side note, using .htpasswd failed, but using htpasswd worked- Why? why can't i use a hidden file ? docker can't find it although it is actually running with root?)



    Then I ran docker run -d -p 1300:5000 --restart=always --name registry -v /opt/ssl:/opt/ssl -e REGISTRY_HTTP_TLS_CERTIFICATE=/opt/ssl/CERT.crt -e REGISTRY_HTTP_TLS_KEY=/opt/ssl/SRV_KEY.key -v /opt/auth:/opt/auth -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/opt/auth/htpasswd registry:2



    (no-auth version of registry was removed off course, also some places suggest to use pwd at the respected location after the -e flag, but that didn't worked- container starts in restarting loop that never ends)



    Now, I can login via web to the registry, (Which I assume proves that the auth process works, ?) but the page is blank. dev tools shows http response 200 for the domain, but I get http response 400 for all else.



    When trying to login via cli to the registry using:



    docker login --username username example.com:1300
    ||



    docker login --username username https://example.com:1300



    I get connection refused.



    • ALL ports are open.

    • password was accepts by the web, so the mechanism is surely working..

    • I checked file permission, all was made by root, so who it is not accessible?

    • service and container are working and up.

    Many sites states that the process I used works, (even on SO) but no real answer on why it is not working.



    Any assistance would be most helpful.










    share|improve this question
























      0












      0








      0








      • I've been trying to install Docker registry with basic auth.

      It should be connected to a gitlab,latest version-
      CentOS Linux release 7.5.1804, 3.10.0-862.14.4.el7.x86_64.
      Docker version: 17.05.0-ce, API version: 1.29



      • Server set up for Registry is:
        AWS CentOS 6.9, 4.14.77-69.57.amzn1.x86_64.
        Docker version: 18.06.1-ce, API version: 1.38

      • Docker is on V2 (Both registry and gitlab)

      This works flawlessly:



      docker run -d -p 1300:5000 --restart=always --name registry -v /opt/ssl:/opt/ssl -e REGISTRY_HTTP_TLS_CERTIFICATE=/opt/ssl/CERT.crt -e REGISTRY_HTTP_TLS_KEY=/opt/ssl/SRV_KEY.key registry:2


      I am able to push, remove and view the images on the web with



      https://example.com:1300/v2/_catalog


      This is where things starting to get complicated,
      I am trying to implement basic Auth onto the registry:



      Initially i ran docker run --entrypoint htpasswd registry:2 -Bbn USER PASSWORD > /opt/auth/htpasswd



      (Side note, using .htpasswd failed, but using htpasswd worked- Why? why can't i use a hidden file ? docker can't find it although it is actually running with root?)



      Then I ran docker run -d -p 1300:5000 --restart=always --name registry -v /opt/ssl:/opt/ssl -e REGISTRY_HTTP_TLS_CERTIFICATE=/opt/ssl/CERT.crt -e REGISTRY_HTTP_TLS_KEY=/opt/ssl/SRV_KEY.key -v /opt/auth:/opt/auth -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/opt/auth/htpasswd registry:2



      (no-auth version of registry was removed off course, also some places suggest to use pwd at the respected location after the -e flag, but that didn't worked- container starts in restarting loop that never ends)



      Now, I can login via web to the registry, (Which I assume proves that the auth process works, ?) but the page is blank. dev tools shows http response 200 for the domain, but I get http response 400 for all else.



      When trying to login via cli to the registry using:



      docker login --username username example.com:1300
      ||



      docker login --username username https://example.com:1300



      I get connection refused.



      • ALL ports are open.

      • password was accepts by the web, so the mechanism is surely working..

      • I checked file permission, all was made by root, so who it is not accessible?

      • service and container are working and up.

      Many sites states that the process I used works, (even on SO) but no real answer on why it is not working.



      Any assistance would be most helpful.










      share|improve this question














      • I've been trying to install Docker registry with basic auth.

      It should be connected to a gitlab,latest version-
      CentOS Linux release 7.5.1804, 3.10.0-862.14.4.el7.x86_64.
      Docker version: 17.05.0-ce, API version: 1.29



      • Server set up for Registry is:
        AWS CentOS 6.9, 4.14.77-69.57.amzn1.x86_64.
        Docker version: 18.06.1-ce, API version: 1.38

      • Docker is on V2 (Both registry and gitlab)

      This works flawlessly:



      docker run -d -p 1300:5000 --restart=always --name registry -v /opt/ssl:/opt/ssl -e REGISTRY_HTTP_TLS_CERTIFICATE=/opt/ssl/CERT.crt -e REGISTRY_HTTP_TLS_KEY=/opt/ssl/SRV_KEY.key registry:2


      I am able to push, remove and view the images on the web with



      https://example.com:1300/v2/_catalog


      This is where things starting to get complicated,
      I am trying to implement basic Auth onto the registry:



      Initially i ran docker run --entrypoint htpasswd registry:2 -Bbn USER PASSWORD > /opt/auth/htpasswd



      (Side note, using .htpasswd failed, but using htpasswd worked- Why? why can't i use a hidden file ? docker can't find it although it is actually running with root?)



      Then I ran docker run -d -p 1300:5000 --restart=always --name registry -v /opt/ssl:/opt/ssl -e REGISTRY_HTTP_TLS_CERTIFICATE=/opt/ssl/CERT.crt -e REGISTRY_HTTP_TLS_KEY=/opt/ssl/SRV_KEY.key -v /opt/auth:/opt/auth -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/opt/auth/htpasswd registry:2



      (no-auth version of registry was removed off course, also some places suggest to use pwd at the respected location after the -e flag, but that didn't worked- container starts in restarting loop that never ends)



      Now, I can login via web to the registry, (Which I assume proves that the auth process works, ?) but the page is blank. dev tools shows http response 200 for the domain, but I get http response 400 for all else.



      When trying to login via cli to the registry using:



      docker login --username username example.com:1300
      ||



      docker login --username username https://example.com:1300



      I get connection refused.



      • ALL ports are open.

      • password was accepts by the web, so the mechanism is surely working..

      • I checked file permission, all was made by root, so who it is not accessible?

      • service and container are working and up.

      Many sites states that the process I used works, (even on SO) but no real answer on why it is not working.



      Any assistance would be most helpful.







      docker authentication ssl docker-registry






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 '18 at 9:48









      BustedBusted

      5310




      5310






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53316585%2fcant-login-to-docker-registry-with-configured-authentication%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53316585%2fcant-login-to-docker-registry-with-configured-authentication%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kleinkühnau

          Makov (Slowakei)

          Deutsches Schauspielhaus