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 index assembles an APKINDEX.tar.gz repository index from a collection of .apk files. The index is the metadata file that APK-based package managers (such as apk on Alpine and Wolfi) read to discover what packages are available, their versions, and their dependencies. Without an index, a directory of APK files cannot be used as a repository. The melange build command generates an index automatically after each build (via --generate-index), but melange index lets you create or rebuild indexes manually — for example, after adding new packages to an existing repository, or when assembling a repository from pre-built packages.
Usage
.apk files are passed as positional arguments. The index is written to APKINDEX.tar.gz by default.
Examples
Flags
| Flag | Short | Default | Description |
|---|---|---|---|
--output | -o | APKINDEX.tar.gz | Output path for the generated index file |
--source | -s | APKINDEX.tar.gz | Existing index file to use as a source for pre-existing entries (used with --merge) |
--merge | -m | false | Merge new package entries with entries from the source index instead of replacing them |
--arch | -a | (all) | Include only packages matching this architecture |
--signing-key | — | (none) | Optional RSA private key to sign the index immediately after creation |
Inherited
| Flag | Default | Description |
|---|---|---|
--log-level | INFO | Log verbosity: debug, info, warn, or error |
Repository structure
A typical multi-architecture repository has one index per architecture directory:--arch flag to avoid mixing architectures:
Merging indexes
Use--merge when you want to add new packages to a repository without removing existing entries from the index. This is common in publishing workflows where packages are built incrementally:
After creating or updating the index, sign it with
melange sign-index to allow package managers to verify its integrity. An unsigned index works for local testing but is rejected by default in production APK configurations.Using the repository
Once the index is created and signed, configureapk to use the repository:
