Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/chainguard-dev/melange/llms.txt

Use this file to discover all available pages before exploring further.

melange lets you build APK packages from source using a simple, declarative YAML configuration. Every step of the build pipeline is fully under your control — from fetching source code to installing binaries — with built-in support for multi-architecture builds, package signing, and integration with apko for creating minimal OCI container images.

Quickstart

Build your first APK package in minutes with a working example.

Installation

Install melange via Homebrew, from source, or using the container image.

Build Configuration

Learn the full melange YAML schema — packages, environments, pipelines, and subpackages.

Command Reference

Explore every CLI command: build, test, lint, keygen, sign, and more.

Why melange?

Secure software factories need reproducible, auditable build processes. melange lets you define your entire build in version-controlled YAML — no hidden state, no manual steps. Every artifact can be signed, attested, and traced back to its source.

Pipeline Ecosystem

Built-in pipelines for Go, Rust/Cargo, Python, Ruby, Maven, npm, and more.

Multi-Architecture

Build for x86_64, aarch64, armv7, and other architectures via QEMU emulation.

Build Caching

Speed up builds with shared caches for Go modules, pip, npm, Maven, and Composer.

Testing & Linting

Validate packages with built-in test pipelines and post-build linting rules.

Get started in 3 steps

1

Install melange

Install using Homebrew or pull the container image:
brew install melange
# or
docker run cgr.dev/chainguard/melange version
2

Write a build configuration

Create a melange.yaml file describing your package, build environment, and pipeline steps.
package:
  name: hello
  version: 2.12
  epoch: 0
  description: "the GNU hello world program"
environment:
  contents:
    packages:
      - build-base
      - busybox
pipeline:
  - uses: fetch
    with:
      uri: https://ftp.gnu.org/gnu/hello/hello-${{package.version}}.tar.gz
      expected-sha256: cf04af86dc085268c5f4470fbae49b18afbc221b78096aab842d934a76bad0ab
  - uses: autoconf/configure
  - uses: autoconf/make
  - uses: autoconf/make-install
  - uses: strip
3

Build your package

Run melange build to produce signed APK files in the packages/ directory:
melange keygen
melange build melange.yaml --signing-key melange.rsa

Integration with apko

melange packages are designed to be consumed by apko, which builds minimal OCI container images from APK packages. Together they form a complete, auditable software factory: melange produces the packages, apko assembles them into images.
The majority of melange-built packages target the Wolfi or Alpine Linux ecosystems. See the Build Configuration reference for all available fields.

Build docs developers (and LLMs) love