Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Latest commit

 

History

History
80 lines (53 loc) · 3.11 KB

repository.md

File metadata and controls

80 lines (53 loc) · 3.11 KB

To load these rules, add this to the top of your BUILD file:

load("@rules_debian_packages//debian_packages:defs.bzl", ...)

debian_packages_repository

debian_packages_repository(name, default_arch, default_distro, lock_file, repo_mapping)

A repository rule to download debian packages using Bazel's downloader.

Typical usage in WORKSPACE.bazel:

load("@rules_debian_packages//debian_packages:defs.bzl", "debian_packages_repository")

debian_packages_repository(
    name = "my_debian_packages",
    default_arch = "amd64",
    default_distro = "debian12",
    lock_file = "//path/to:debian_packages.lock",
)

load("@my_debian_packages//:packages.bzl", "install_deps")

install_deps()

Packages can be used for rules_docker based container images like this:

load("@io_bazel_rules_docker//container:container.bzl", "container_image")
load("@my_debian_packages//:packages.bzl", "debian_package")

container_image(
    name = "my_image",
    debs = [
        debian_package("busybox-static"),
    ],
)

Packages can be used for rules_oci based container images like this:

load("@rules_oci//oci:defs.bzl", "oci_image")
load("@my_debian_packages//:packages.bzl", "debian_package_layer")

oci_image(
    name = "my_image",
    tars = [
        debian_package_layer("busybox-static"),
    ],
)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this repository. Name required
default_arch The architecture to assume as default. String required
default_distro The debian-distro to assume as default. String required
lock_file The lockfile to generate a repository from. Label required
repo_mapping A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.<p>For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target, it should actually resolve that dependency within globally-declared @bar (@bar//some:target). Dictionary: String -> String required