...

Text file src/edge-infra.dev/hack/containers/kubectl/BUILD.bazel

Documentation: edge-infra.dev/hack/containers/kubectl

     1load("@container_structure_test//:defs.bzl", "container_structure_test")
     2load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")
     3load("@rules_pkg//:pkg.bzl", "pkg_tar")
     4load("//hack/build/rules/container:index.bzl", "container_push")
     5
     6# TODO: should be rootless
     7
     8pkg_tar(
     9    name = "kubectl_tar",
    10    extension = "tgz",
    11    files = {
    12        "//hack/tools:kubectl": "kubectl",
    13    },
    14    mode = "755",
    15    package_dir = "/usr/local/bin",
    16    tags = ["manual"],
    17)
    18
    19oci_image(
    20    name = "container",
    21    base = "@distroless_base",
    22    entrypoint = ["/usr/local/bin/kubectl"],
    23    tags = ["manual"],
    24    tars = [
    25        ":kubectl_tar",
    26    ],
    27)
    28
    29oci_load(
    30    name = "kubectl-oci-load",
    31    image = ":container",
    32    repo_tags = ["kubectl-oci:latest"],
    33    tags = ["manual"],
    34)
    35
    36filegroup(
    37    name = "kubectl-oci.tar",
    38    srcs = [":kubectl-oci-load"],
    39    output_group = "tarball",
    40)
    41
    42container_structure_test(
    43    name = "kubectl-test",
    44    configs = [":kubectl-test.yaml"],
    45    driver = "tar",
    46    image = ":kubectl-oci.tar",
    47)
    48
    49container_push(
    50    image = ":container",
    51    image_name = "kubectl",
    52    repository_file = "//hack/build/rules/container:workloads-repo",
    53    tags = ["manual"],
    54)

View as plain text