Melange is a declarative apk builder tool used to create apk packages. It uses a YAML file to define melange apks, which are compatible with apk-based systems including Alpine. Melange packages are built using declarative pipelines.
To get started with Melange, you can follow the “Getting Started with Melange” tutorial on the Chainguard Education platform. This tutorial covers installing Melange, generating melange signing keys, and building a PHP package using Melange.
Melange packages are defined using a YAML file that includes metadata about the apk package, such as its name, version, and dependencies. Here’s an example of a Melange YAML file:
package:
name: hello
version: 2.12
epoch: 0
description: A simple hello world application
target-architecture:
- all
copyright:
- "Copyright (C) 2022 The Melange Authors"
dependencies:
- apk-tools
- busybox
Melange supports building packages for multiple architectures, including x86, x86_64, armv7, and aarch64. To build a package, run the following command:
docker run --privileged --rm -v "$(pwd)":/work -- \
cgr.dev/chainguard/melange build melange.yaml \
--arch x86_64 \
--signing-key melange.rsa \
--keyring-append melange.rsa.pub
Replace melange.yaml
with the name of your Melange YAML file and x86_64
with the target architecture.
For more information on Melange, refer to the Melange Overview and Melange YAML Reference pages on the Chainguard Education platform.