Skip to main content

Container Registry Config Generator

Generate docker login commands, Kubernetes imagePullSecret YAML, and GitHub Actions steps for your registry. Supports DockerHub, ECR, GCR, ACR, and GHCR.

✓ docker login command ✓ Kubernetes imagePullSecret YAML ✓ GitHub Actions workflow step ✓ All major registries

Registry Configuration

Use an access token, not your account password.

Login command
 

Frequently Asked Questions

What is an imagePullSecret in Kubernetes?▼

An imagePullSecret is a Kubernetes Secret that holds container registry credentials. When specified in a Pod spec, Kubernetes uses it to authenticate with a private registry before pulling images. Without it, pulling from private registries returns 401 Unauthorized (ImagePullBackOff). Create it with: kubectl create secret docker-registry.

What is the difference between ECR, GCR, ACR, and GHCR?▼

ECR (Elastic Container Registry) is AWS's managed registry, integrated with IAM. GCR (Google Container Registry) / Artifact Registry is GCP's registry. ACR (Azure Container Registry) is Azure's registry. GHCR (GitHub Container Registry) is GitHub's free registry for public/private images. Each has different auth methods: ECR uses AWS tokens (short-lived), others typically use static credentials or service accounts.

How do ECR credentials work with Kubernetes?▼

AWS ECR tokens expire after 12 hours, which breaks static imagePullSecrets. Solutions: (1) Use ECR credential helper (aws-ecr-credential-provider as a node plugin), (2) Use a CronJob to refresh the secret every 6 hours, or (3) Use IAM roles for service accounts (IRSA) with kube2iam/KIAM on EKS. Option 3 is the production-grade approach.

How do I use GHCR in GitHub Actions?▼

GHCR integrates natively with GitHub Actions via GITHUB_TOKEN (no PAT needed for same-repo images). Use: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin. Then push to ghcr.io/<org>/<image>:<tag>. For pulling from other repos, create a PAT with read:packages scope.

Should I use a Personal Access Token or Service Account for registry auth?▼

For production, always use service accounts / machine credentials, never personal tokens. PATs are tied to individual users — if that person leaves, access breaks. Use: Docker Hub organization access tokens, AWS IAM roles, GCP Service Accounts with Workload Identity, or ACR service principals. Store credentials in Kubernetes Secrets, never in Dockerfiles or source code.

How do I configure imagePullSecrets for all pods in a namespace?▼

Attach the imagePullSecret to the default ServiceAccount in the namespace: kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "regcred"}]}' -n <namespace>. All pods that don't specify a serviceAccountName will inherit it. This avoids adding imagePullSecrets to every Deployment manually.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →