Docker login to internal registry failed with service account as username
Issue
- Failed to login to the internal registry when Openshift cluster is log in with service account
# oc whoami
system:serviceaccount:serviceac:test
# docker -D login -u $(oc whoami) -p $(oc whoami -t) docker-registry.default.svc:5000
Error response from daemon: Get https://docker-registry.default.svc:5000/v2/: unauthorized: authentication required
Environment
OpenShift Container Platform 3.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.