rules_apko icon indicating copy to clipboard operation
rules_apko copied to clipboard

Guidance: Adding a locally build .apk package

Open aj185259 opened this issue 1 year ago • 1 comments

Hi all,

I'm using rules_apko to build our Alpine images, but any that require an apk package not provided by an online mirror doesn't seem to be possible. For instance if I wanted to build a melange built package or a package built by one of our other teams, it doesn't seem to be able to accommodate that.

The closest I've gotten is being able to apko lock a local package, but it can't make its way into the apko_image via the lockfile.

Any thoughts or guidance on this would be greatly appreciated.

Thanks!

aj185259 avatar Mar 28 '24 17:03 aj185259

I think this is currently not supported but it sounds like a good feature request.

The changes needed would be non trivial though. The place where the "remote package" is assumed is https://github.com/chainguard-dev/rules_apko/blob/1d78765293a0baf3f92ca49efa51d6c02b9c828e/apko/private/apk.bzl#L42C5-L42C21

There are analogous rules for apk_repository and apk_keyring

All of these are used in translate_apko_lock (https://github.com/chainguard-dev/rules_apko/blob/1d78765293a0baf3f92ca49efa51d6c02b9c828e/apko/translate_lock.bzl#L87). I think there or in apk_import would need to be some logic to distinguish local from remote packages.

sfc-gh-mhazy avatar May 09 '24 10:05 sfc-gh-mhazy