How to login to docker azure registry from Jenkins pipeline using 'withCredential' returns TTY error How to login to docker azure registry from Jenkins pipeline using 'withCredential' returns TTY error docker docker

How to login to docker azure registry from Jenkins pipeline using 'withCredential' returns TTY error


After trying out many different ways, one worked. The username must be provided, only the password can be passed as variable.

So instead of

sh "docker login myAzureRepo.azurecr.io -u $DOCKER_USER -p $DOCKER_PASSWORD"

I used

sh "docker login myAzureRepo.azurecr.io -u admin -p $DOCKER_PASSWORD"

And worked fine. At least the password is hidden.

The registry in the examples is a made one one, the registry I am working on has different name and credentials.

But if you know better ways, please spread the love. I am just starting working with Jenkins, docker and microservices and am loving it.