# syntax=docker/dockerfile-upstream:master FROM python:3.10-slim as base ENV DEBIAN_FRONTEND=noninteractive WORKDIR /workspace RUN --mount=type=cache,target=/var/lib/apt \ --mount=type=cache,target=/var/cache/apt \ apt-get update && \ apt-get install -q -y --no-install-recommends --allow-remove-essential \ bash build-essential ca-certificates git tree FROM base as protobuf-3 COPY <<-EOT requirements.txt protobuf>=3.5.0,<4.0dev grpcio-tools mypy-protobuf EOT RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt FROM base as protobuf-4 COPY <<-EOT requirements.txt protobuf>=4.0,<5.0dev grpcio-tools mypy-protobuf EOT RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt ############################################ # BentoML gRPC protobuf 3 generation FROM protobuf-3 as run-grpcio-tools-3 ARG PROTOCOL_VERSION ARG GENERATED_PB3_DIR RUN mkdir -p /result/${GENERATED_PB3_DIR} RUN --mount=type=bind,target=.,rw <