Skip to main content
Container images package applications and their dependencies into portable, read-only templates. Registries host these images so you can pull them to any host and run containers from them. This makes distributing and deploying software predictable and repeatable. Most organizations publish images to public or private registries. The most popular public registry is Docker Hub, but there are several alternatives and cloud-hosted registries:
A slide titled "Images And Registries" showing a Public Docker Registry panel (Ansible, MongoDB, Redis, Node.js) and a list of other registries (GitHub, Google Artifact, AWS ECR, Azure). A presenter wearing a KodeKloud t-shirt stands on the right.
Use the table below to quickly compare common container registries and when to use them.
Run docker run <image> to pull an image from the configured registry (Docker Hub by default) if it’s not already present locally. Docker then creates and starts a container from that image. To run in the background, add -d; to map ports use -p, and to assign a container name use --name.
Example: running images with Docker
If you need multiple instances of a service, launch multiple containers from the same image (run the same docker run command multiple times). In production, place a load balancer in front of instances or use an orchestrator to handle scaling and health checks automatically. Useful orchestrators and service managers: Images vs. Containers Building and publishing your own images If a public image doesn’t meet your needs, build a custom image with a Dockerfile and push it to a registry you control:
Be cautious when using public images. Prefer official or verified images, check image sizes and Dockerfile practices, and avoid running untrusted images as root. For private artifacts, use authenticated registries (e.g., ECR, ACR) and secure credentials with your CI/CD system.
Summary
  • Registries host container images for distribution; Docker Hub is the default but many cloud and private registries exist.
  • docker run pulls, creates, and starts a container from an image; add flags like -d, -p, and --name to control behavior.
  • Images are immutable templates; containers are running instances with writable layers.
  • Build and push your own images when public images don’t fit your needs, and use orchestrators to manage scaling and resilience in production.
Links and references

Watch Video