ARG CUDA_VERSION=12.8.1

FROM pytorch/manylinux2_28-builder:cuda12.8

ARG BUILD_TYPE=all
ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /sgl-workspace

RUN pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu128

RUN pip3 install https://github.com/sgl-project/whl/releases/download/v0.0.8.post1/sgl_kernel-0.0.8.post1+cu128-cp39-abi3-manylinux2014_x86_64.whl \
    && pip3 install setuptools==75.0.0 wheel==0.41.0 scikit-build-core

RUN git clone --depth=1 https://github.com/sgl-project/sglang.git \
    && cd sglang && pip3 install -e "python[blackwell]"

RUN pip3 install nvidia-nccl-cu12==2.26.2.post1 --force-reinstall --no-deps

ENV DEBIAN_FRONTEND=interactive
