What is a CI/CD "artifact repository" or "registry", and why do you need one?

BeginnerConceptCI/CD practices
Answer

In one line: An artifact repository (or registry) is a central, versioned store for build outputs — Docker images, JARs, npm packages, Helm charts — so every environment pulls the exact same tested artifact.

Common tools:

  • Universal repositories: JFrog Artifactory, Sonatype Nexus (Docker, Maven, npm, PyPI, Helm and more in one place).
  • Container registries: AWS ECR, Azure ACR, Google Artifact Registry, Docker Hub, GitHub Container Registry, Harbor.
  • Package registries: GitHub Packages, GitLab Package Registry.

Why you need one:

  1. Single source for deployments — production pulls orders:1.4.2 from the registry, not from someone's laptop.
  2. Versioning and history — keep every version for rollbacks and audits.
  3. Build once, deploy many — the pipeline pushes once; every environment pulls the same artifact.
  4. Proxy / cache for public packages — Nexus or Artifactory can cache Maven Central, npm and Docker Hub. Builds are faster, keep working if the public site is down, and avoid rate limits.
  5. Security — scan artifacts for vulnerabilities (Trivy, Xray, Harbor's built-in scanning), sign them and control who can push or pull.
  6. Access control — private packages are only available to your organisation.

Good practices:

  • Immutable tags — don't allow overwriting a version (ECR has a setting for this).
  • Retention policies — delete old, unused artifacts automatically to save storage, but keep released versions.
  • Separate repositories for snapshots/dev builds and releases.
  • Scan on push and block deployment of images with critical vulnerabilities.

Example: a pipeline pushes 123456789012.dkr.ecr.ap-south-1.amazonaws.com/orders:1.4.2; ECR scans it on push; a lifecycle policy removes untagged images older than 14 days.

Tip for interviews: mention the proxy/cache use case and immutable tags — they show practical experience.

All DevOps Fundamentals questions

More on CI/CD practices