Initial setup
rules_apko requires a one-time setup to configure bazel to be able to make partial fetches.
See the issue: https://github.com/bazelbuild/bazel/issues/17829
Paste this into your root BUILD file
load("@rules_apko//apko:defs.bzl", "apko_bazelrc")
apko_bazelrc()
NOTE: by default
apko_bazelrc
will generate.bazelrc
to accomodate for fetching fromdl-cdn.alpinelinux.org
andpackages.wolfi.dev
. this can be configured by passing therepositories
attribute toapko_bazelrc()
call.
Then run
bazel run @@//:apko_bazelrc && chmod +x .apko/range.sh
And finally paste this into your preferred `.bazelrc` file,
# Required for rules_apko to make range requests
try-import %workspace%/.apko/.bazelrc