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:
- Single source for deployments — production pulls
orders:1.4.2from the registry, not from someone's laptop. - Versioning and history — keep every version for rollbacks and audits.
- Build once, deploy many — the pipeline pushes once; every environment pulls the same artifact.
- 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.
- Security — scan artifacts for vulnerabilities (Trivy, Xray, Harbor's built-in scanning), sign them and control who can push or pull.
- 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.
More on CI/CD practices
What is "pipeline as code", and why is it better than configuring pipelines in a UI?BeginnerWhat is a build agent or runner?BeginnerWhat are pipeline triggers?BeginnerWhat is a quality gate in a CI/CD pipeline?BeginnerHow do you make a slow CI/CD pipeline faster?BeginnerWhat are secrets in CI/CD, and how should they be handled?Beginner