How do I add my docker credentials to Okteto so I can use private images in my Docker Compose?

I want to be able to use private images on the Docker Compose I’m using in Okteto. Is there a way to specify the credentials?

Specifying docker credentials to Okteto is fairly easy - all you need to do is configure a pull secret like you would in the case of Kubernetes manifests.

If you’re looking to add the credentials for your default service account, then you could also create a secret called docker-registry instead:

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

Once that is done, just update your service account, and it will automatically inject the credentials secret when deploying resources in the namespace:

$ kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "regcred"}]}'
1 Like