Reproducible Builds

Definition

Reproducible builds are a set of software development practices that ensure identical binary outputs are generated from the same source code, build environment, and build instructions. This process enhances security by allowing developers and users to verify that the distributed binaries have not been tampered with and truly correspond to the source code. By using deterministic build processes, reproducible builds help in detecting and preventing supply chain attacks and ensuring the integrity of software distributions.

Secure Settings Example

# Example of a reproducible build configuration using Docker
version: '3.8'
services:
  app:
    build:
      context: ../../../../PycharmProjects/definitions-for-site/content
      dockerfile: Dockerfile
      args:
        - BUILD_DATE=2023-10-01T00:00:00Z
        - SOURCE_COMMIT=abcdef1234567890
    environment:
      - SOURCE_DATE_EPOCH=1696118400

Insecure Settings Example

# Example of a non-reproducible build configuration
version: '3.8'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      # Missing fixed build date and source commit, leading to non-deterministic builds
      - BUILD_DATE=$(date)
      - SOURCE_COMMIT=$(git rev-parse HEAD)