Skip to main content
In this lesson, you’ll learn how to secure container images by:
  • Understanding image naming conventions
  • Working with secure image registries
  • Configuring Pods to pull from private repositories
Previously, we deployed Pods running web apps, databases, and caches. Let’s begin with a simple Pod definition that uses the official nginx image:

Understanding Image Names

Docker interprets image: 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:
You can also pull from other public registries. For example, Google’s registry hosts Kubernetes test images:

Common Public Registries

Using a Private Registry

For in-house applications, you can host your own registry or use a managed solution: To pull from a private registry, follow these steps:
  1. Authenticate locally (for pushing and testing)
Avoid committing ~/.docker/config.json to version control.
Store credentials securely (e.g., using a secrets manager).
  1. Create a Kubernetes Secret of type docker-registry so worker nodes can pull the image:
  2. 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.

Watch Video

Practice Lab