What makes a build reproducible, and why does it matter?
AdvancedConceptFundamentals and Pipeline Design
Answer
A reproducible build produces the same output (ideally bit-for-bit identical) from the same source and inputs, no matter when or where it runs. It matters for debugging, rollbacks, audit and supply chain trust (you can verify a binary matches its source).
What breaks it: floating dependency versions, latest base images, timestamps embedded in artifacts, build-time network downloads, and differing toolchains on agents. What we do:
- Pin dependencies with lockfiles (
package-lock.json,poetry.lock,go.sum) and usenpm ci. - Pin base images by digest (
FROM node:22-slim@sha256:...). - Run builds in a pinned container image and set
SOURCE_DATE_EPOCH. - Prefer hermetic tools such as Bazel or Nix for strict isolation.
More on Fundamentals and Pipeline Design
What is Continuous Integration (CI)?BeginnerWhat is the difference between Continuous Delivery and Continuous Deployment?IntermediateWhat is a CI/CD pipeline and what are its stages?BeginnerWhy should a pipeline "fail fast", and how do you order stages to achieve it?IntermediateHow does your branching strategy affect CI? Compare trunk-based development with GitFlow.IntermediateWhat is a build artifact?Beginner