Packaging and signing

tools/apkpkg.py builds, indexes and verifies Alpine packages (apk v2 format) on macOS, without abuild. An apk v2 package is three gzip streams glued together: a signature (RSA/SHA-256 over the next stream), the control stream (.PKGINFO, with the sha256 of the data), and the data tar.


apkpkg.py build <rootdir> <out.apk> <private.rsa> <pubkey-name> key=value...
apkpkg.py index <repo-arch-dir> <private.rsa> <pubkey-name> [description]
apkpkg.py verify <file.apk|APKINDEX.tar.gz> <keys-dir>
apkpkg.py app <apps/id> <repo-arch-dir> <private.rsa> <pubkey-name>
apkpkg.py catalog <repo-arch-dir> <private.rsa>
apkpkg.py transitional <repo-arch-dir> <private.rsa> <pubkey-name> <old> <version> <new>
apkpkg.py --test

The signing key never leaves the maintainer's Mac; its public half is copied into profile/overlay/etc/apk/keys/. transitional makes an empty package under the old name that depends on the new one (used when a package is renamed). The image's checksums are signed with the same key: verify a download with openssl dgst -sha256 -verify <pub> -signature <name>.SHA256SUMS.sig <name>.SHA256SUMS.

Updated on