ARG BASE_IMAGE=ubuntu:24.04 ARG GRPC_BASE_IMAGE=${BASE_IMAGE} ARG APT_MIRROR="" ARG APT_PORTS_MIRROR="" # The grpc target does one thing, it builds and installs GRPC. This is in it's own layer so that it can be effectively cached by CI. # You probably don't need to change anything here, and if you do, make sure that CI is adjusted so that the cache continues to work. FROM ${GRPC_BASE_IMAGE} AS grpc # This is a bit of a hack, but it's required in order to be able to effectively cache this layer in CI ARG GRPC_MAKEFLAGS="-j4 -Otarget" ARG GRPC_VERSION=v1.65.0 ARG CMAKE_FROM_SOURCE=false # CUDA Toolkit 13.x compatibility: CMake 3.31.9+ fixes toolchain detection/arch table issues ARG CMAKE_VERSION=3.31.10 ARG APT_MIRROR ARG APT_PORTS_MIRROR ENV MAKEFLAGS=${GRPC_MAKEFLAGS} WORKDIR /build RUN --mount=type=bind,source=.docker/apt-mirror.sh,target=/usr/local/sbin/apt-mirror \ APT_MIRROR="${APT_MIRROR}" APT_PORTS_MIRROR="${APT_PORTS_MIRROR}" sh /usr/local/sbin/apt-mirror && \ apt-get update && \ apt-get install -y --no-install-recommends \ ca-certificates \ build-essential curl libssl-dev \ git wget && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Install CMake (the version in 22.04 is too old) RUN </dev/null || ls /opt/rocm*/lib64/rocblas/library/Kernels* 2>/dev/null) | grep -oP 'gfx[0-9a-z+-]+' | sort -u || \ echo "WARNING: No rocBLAS kernel data found" \ ; fi RUN echo "TARGETARCH: $TARGETARCH" # We need protoc installed, and the version in 22.04 is too old. We will create one as part installing the GRPC build below # but that will also being in a newer version of absl which stablediffusion cannot compile with. This version of protoc is only # here so that we can generate the grpc code for the stablediffusion build RUN <