I have a block in my pipeline script like the following:
Before this block of code, I extracted the username and password from the credential, and they are correct.
In the log, I watched it build the image, tag it, but then when it tried to push it, it failed to authenticate. I didn't see a "docker login" command line in the log.
I then tried to manually run the docker commands from the shell, on the same box the job is running on, starting with "docker login". That entire process worked.
I then reran my job, and it also worked.
I then moved my "~/.docker/config.json" file out of the way and reran my job, and it failed to authenticate again. It's just not attempting "docker login".