How do you manage Docker registry credentials for build and deploy pipelines?
BeginnerProductionSecrets and Credentials
Answer
Prefer built-in, short-lived credentials: GITHUB_TOKEN for GHCR, CI_JOB_TOKEN/CI_REGISTRY_PASSWORD for GitLab, OIDC-assumed IAM role with aws ecr get-login-password for ECR. Always log in with --password-stdin. Give build jobs push rights to the registry but not delete rights, and give clusters pull-only credentials (node role or imagePullSecrets).
aws ecr get-login-password --region ap-south-1 | \
docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com
More on Secrets and Credentials
Why are long-lived credentials in CI a problem, and what is the modern alternative?BeginnerHow do you manage application secrets from build to runtime?IntermediateHow do you store secrets in Git safely for GitOps?IntermediateHow do you detect secrets committed to a repo?BeginnerWhat do you do after a secret is committed to Git?IntermediateHow do you use HashiCorp Vault with CI/CD?Advanced