🐳 Docker Beginner

What is a Docker registry?

Answer

A Docker registry is a storage and distribution system for Docker images. It allows you to push (upload), pull (download), and share Docker images across teams and environments. Docker Hub is the most well-known public registry. Types: Public registries: Docker Hub (docker.io), GitHub Container Registry (ghcr.io), Quay.io — images publicly accessible. Private registries: Amazon ECR (Elastic Container Registry), Google GCR/Artifact Registry, Azure Container Registry, GitHub Container Registry (private repos) — require authentication. Self-hosted: Docker Registry (open-source), Harbor (enterprise-grade, with scanning and role-based access), JFrog Artifactory. Registry interaction: docker login ghcr.io — authenticate; docker tag myapp:1.0 ghcr.io/username/myapp:1.0 — tag with full registry path; docker push ghcr.io/username/myapp:1.0 — push; docker pull ghcr.io/username/myapp:1.0 — pull. In Kubernetes, configure registry credentials as Kubernetes secrets for pulling from private registries. For CI/CD, use ephemeral registry credentials via environment variables or service accounts. Always use specific image tags (not latest) in production for reproducibility.