tflite-micro/python/tflite_micro/pypi_build.dockerfile
Ryan Kuester e6a8627f4e
fix(pypi): repair wheel build for bzlmod (#3653)
Repair the nightly PyPI wheel build, broken since the bzlmod
migration deleted the WORKSPACE file. The build script looked for
that file to find the top of the source tree, and died. The build
image's bazelisk, 1.18.0, likewise recognized only WORKSPACE as
the tree-top marker, so it never found .bazelversion and ran the
latest bazel release instead of the pinned 8.7.0.

Find the tree top by the MODULE.bazel file instead, and bump
bazelisk to 1.29.0, which recognizes MODULE.bazel, finds
.bazelversion, and runs the pinned bazel.
2026-08-11 14:53:45 +00:00

16 lines
913 B
Docker

# Use the Python Packaging Authority's reference build environment
# for binary extensions. Binary extensions are typically built and distributed
# for each target Python version and OS platform. The reference build
# environment contains Python installations for each version, and a C/C++
# toolchain specified for maximum compatibility among x86_64 Linux platforms.
FROM quay.io/pypa/manylinux_2_28_x86_64
# Install bazel (via bazelisk)
ENV BAZELISK=https://github.com/bazelbuild/bazelisk/releases/download/v1.29.0/bazelisk-linux-amd64
ENV BAZEL=/usr/local/bin/bazel
RUN curl --output $BAZEL --location $BAZELISK && chmod 755 $BAZEL
# Append the location of the C/C++ toolchain to the default PATH, where
# bazel expects to find it. The reference environment provides the location
# (typically somewhere under /opt) in DEVTOOLSET_ROOTPATH.
RUN echo "PATH="${PATH}:/${DEVTOOLSET_ROOTPATH}"" >>/etc/environment