melange runs on Linux and macOS and can be installed in several ways depending on your workflow. For most users, Homebrew is the simplest option. If you prefer not to install a binary locally, the official container image lets you run melange through Docker or Podman without any installation at all.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.
Requirements
Regardless of how you install melange, you will need one of the following container runtimes available on your host to execute build pipelines: melange uses bubblewrap (bwrap) to isolate builds when running natively, and requires elevated privileges (--privileged) when running inside a Docker container.
Installation methods
Homebrew (macOS and Linux)
Homebrew is the recommended installation method for macOS and is also supported on Linux.brew upgrade melange.
go install (any platform with Go 1.22+)
If you have Go installed, you can build and install the latest melange release directly from source using go install:
$(go env GOPATH)/bin. Make sure that directory is on your PATH.
Container image (Docker / Podman)
The official melange container image is published tocgr.dev/chainguard/melange and is rebuilt and signed on every release. This method requires no local installation — you run melange as a Docker command.
Verify the image is accessible:
Running builds with Docker
To build an APK with the container image, mount your working directory into the container at/work and pass --privileged so bubblewrap can set up the isolated build guest:
Build from source
To build melange from its Git repository, clone the repo and rungo build:
PATH:
Verify the installation
After installing by any method, confirm melange is working:Shell completion
melange includes acompletion subcommand that generates shell completion scripts for Bash, Zsh, Fish, and PowerShell.
After installing a permanent completion script, start a new shell session for the completions to take effect.
Choosing a runner
By default, melange selects a runner based on your platform. You can override this with the--runner flag on melange build:
| Runner | When to use |
|---|---|
bubblewrap | Default on Linux when running melange natively. Requires no container daemon. |
docker | Use when bubblewrap is unavailable or when running on macOS. Requires Docker. |
qemu | Use for cross-architecture builds that need full machine emulation. |
Next steps
Quickstart
Build your first APK package with the GNU Hello example.
Introduction
Learn about the melange build model and its relationship with apko.
