FROM quay.io/fedora/fedora:43 as builder

COPY container-images/intel-gpu/oneAPI.repo /etc/yum.repos.d/
COPY container-images/scripts/build_llama_and_whisper.sh \
     container-images/scripts/lib.sh \
     /src/
WORKDIR /src/
RUN ./build_llama_and_whisper.sh intel-gpu

FROM quay.io/fedora/fedora:43

COPY --from=builder /tmp/install/ /usr/
COPY container-images/intel-gpu/oneAPI.repo /etc/yum.repos.d/

RUN dnf install -y --setopt=install_weak_deps=false \
      procps-ng intel-oneapi-runtime-mkl intel-oneapi-mkl-sycl-dft \
      intel-level-zero oneapi-level-zero intel-compute-runtime libcurl lspci \
      clinfo intel-oneapi-runtime-compilers intel-oneapi-mkl-core \
      intel-oneapi-mkl-sycl-blas intel-oneapi-runtime-dnnl gawk

COPY --chmod=755 container-images/intel-gpu/entrypoint.sh /usr/bin/

ENTRYPOINT ["/usr/bin/entrypoint.sh"]
