Interview Prep/CI/CD/Secrets and Credentials

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
All CI/CD questions

More on Secrets and Credentials