
Image name format (Docker/OCI naming convention)
Container image names follow the general pattern: [registry-host[:port]/][namespace/]repository[:tag] Breakdown:
Examples:
nginx
Equivalent todocker.io/library/nginx:latestmyorg/webapp:1.0
Pullswebappfromdocker.io/myorgwith tag1.0gcr.io/my-project/my-image:stable
Pulls from Google Container Registry
library namespace + latest tag), so being explicit improves reproducibility and security.
Common registries
Public registries provide easy access, but for proprietary or internal images prefer a private registry with access control.
Pulling private images with Docker (local)
Before running an image from a private registry with Docker locally, authenticate:Kubernetes: pulling images from a private registry
The kubelet running on worker nodes must authenticate to the registry to pull private images. Kubernetes supports this via a secret of typekubernetes.io/dockerconfigjson (created with kubectl create secret docker-registry) and referencing that secret from Pod specs using imagePullSecrets.
Create the registry secret (replace server/username/password/email with real values):
regcred to authenticate to private-registry.io and pull the specified image.
Make sure the
docker-registry secret exists in the same namespace as the Pod. If you don’t create the secret in the Pod’s namespace, Kubernetes cannot find it to use for image pulls.Best practices for image security
- Use explicit fully qualified image names (registry + namespace + tag or digest) to avoid unintended pulls from public registries.
- Prefer immutable references (image digests, e.g.
@sha256:...) for production to ensure exact image content. - Restrict registry access using strong credentials or IAM-based authentication (e.g., AWS IAM for ECR, GCP IAM for GCR).
- Scan images for vulnerabilities before deploying (CI/CD integration).
- Keep secrets scoped to the namespace that needs them and follow least privilege.
References and further reading
- Kubernetes docs: Pull an image from a private registry — https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
- Docker Hub — https://hub.docker.com
- Google Container Registry — https://cloud.google.com/container-registry
- Amazon ECR — https://aws.amazon.com/ecr/
- Azure Container Registry — https://azure.microsoft.com/en-us/services/container-registry/
- Harbor — https://goharbor.io