- Understanding image naming conventions
- Working with secure image registries
- Configuring Pods to pull from private repositories
Understanding Image Names
Docker interpretsimage: nginx as library/nginx under the hood. The full naming convention is:
- Omit the registry → defaults to Docker Hub (
docker.io) - Omit the namespace → defaults to
library(the official account)
Specifying:is equivalent to:
Common Public Registries
| Registry | URL | Use Case |
|---|---|---|
| Docker Hub | docker.io | Default public images |
| Google Artifact Registry | gcr.io | Google-hosted Kubernetes images |
| Quay.io | quay.io | CI/CD and enterprise images |
Using a Private Registry
For in-house applications, you can host your own registry or use a managed solution:| Provider | Link |
|---|---|
| AWS ECR | https://aws.amazon.com/ecr/ |
| Azure Container Registry | https://azure.microsoft.com/services/container-registry/ |
| Google Artifact Registry | https://cloud.google.com/artifact-registry |
- Authenticate locally (for pushing and testing)
Avoid committing
Store credentials securely (e.g., using a secrets manager).
~/.docker/config.json to version control.Store credentials securely (e.g., using a secrets manager).
-
Create a Kubernetes Secret of type
docker-registryso worker nodes can pull the image: -
Reference the Secret in your Pod spec under
imagePullSecrets:When this Pod is scheduled, the kubelet uses the Secret to authenticate and pull the private image.