Currently melange
relies on apk
, which is currently
not available for mac.
This page documents workarounds to run
melange
on a mac.
Use the official container image:
$ docker run --privileged -v "$PWD":/work cgr.dev/chainguard/melange build examples/gnu-hello.yaml
We maintain an example configuration file for
Lima
(see lima/melange-playground.yaml
).
This provides a VM with the following:
- 1 CPU, 2GiB memory, 10GiB disk
- Latest release of
melange
(from GitHub releases) - Useful tools such as
vim
- Example config files from the repo at
/examples
Root shell is needed for apko build
. We also override $HOME
with
your mac's $HOME
(mounted into the VM) so that Docker credential
helpers work properly with apko publish
.
The commands below assume to be run in this
directory of the repository, and require limactl
.
git clone https://github.com/chainguard-dev/melange.git
cd melange
limactl start --tty=false mac/lima/melange-playground.yaml
limactl shell melange-playground sudo su -c "HOME=\"${HOME}\" ash"
melange build --keyring-append /usr/lib/wolfi-signing.rsa.pub --arch amd64 examples/gnu-hello.yaml