Skip to content

[Question] Understanding how the images are build with bazel #1733

@lukas2510

Description

@lukas2510

Hey,
I am trying to understand how the distroless images are being build with bazel. And in the next step I want to adjust the code to build the python images with a new python version. Currently they have python 3.11 and I want to build them with python 3.13 in the images.

I looked at the code and forked the repository trying to build the images on my own. I encountered some questions I didn't find answers for.

  1. Why is there a ~ symbol in the repository label? is this a placeholder and will be replaced with something?
    load("@@rules_distroless~//apt:defs.bzl", "dpkg_statusd")
    load("@@rules_pkg~//:pkg.bzl", "pkg_tar")
  2. When I try to run bazel build //... on my local machine I run into the error message:
    ERROR: /home/user/.cache/bazel/_bazel_user/1f7992ad81ee9cefa6220f093020f63e/external/+java+temurin21_jre_arm64/BUILD.bazel: no such target '@@+java+temurin21_jre_arm64//:temurin21_jre_arm64': target 'temurin21_jre_arm64' not declared in package '' defined by /home/user/.cache/bazel/_bazel_user/1f7992ad81ee9cefa6220f093020f63e/external/+java+temurin21_jre_arm64/BUILD.bazel
  3. Is there a way to build the images locally? and if yes how?

I am new to bazel and would appreciate it if someone could answer my questions and help me to understand how the distroless images get build with bazel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions