Today, to define DockerHub credentials, you have to define an empty url in docker.withRegistry('', 'my-dockerhub-credentials').

      It supports an empty string '' but not null.

      It would be nice to also support null: docker.withRegistry(null, 'my-dockerhub-credentials') and maybe to add a method such as docker.withRegistryCredentials(credentials).

          [JENKINS-31608] Better support of DockerHub credentials

          Jesse Glick added a comment -

          This code needs a null check. Also documentation needs to mention that null is allowed to refer to DockerHub.

          Jesse Glick added a comment - This code needs a null check. Also documentation needs to mention that null is allowed to refer to DockerHub.

          Cyrille Le Clerc added a comment - - edited

          jglick you don't seem to be excited by my idea of docker.withRegistryCredentials(credentials)

          Cyrille Le Clerc added a comment - - edited jglick you don't seem to be excited by my idea of docker.withRegistryCredentials(credentials)

          Jesse Glick added a comment -

          I would rather not introduce another top-level method if it can be avoided.

          Jesse Glick added a comment - I would rather not introduce another top-level method if it can be avoided.

            jglick Jesse Glick
            cleclerc Cyrille Le Clerc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: