kubectl: I already have a .dockercfg file. How do I create a docker-registry secret with it?

12/10/2018

According to the kubernetes docs, I can create a docker-registry secret using the following command:

kubectl create secret docker-registry regcred --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email>

This generates a secret with a key of .dockercfg.

I already have a .dockercfg file generated by another tool, how can I use kubectl to create the docker-registry secret from my .dockercfg file?

-- simon
kubectl
kubernetes

0 Answers