Dockerfile 900 B

123456789101112131415161718192021222324252627
  1. FROM rust:1.71-bullseye as builder
  2. RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
  3. | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
  4. echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | \
  5. tee /etc/apt/sources.list.d/oneAPI.list
  6. RUN apt update
  7. RUN apt install -y intel-oneapi-mkl-devel libomp-dev
  8. WORKDIR /usr/src/kuberian
  9. ENV HF_HOME=/model
  10. COPY Cargo.toml .
  11. COPY ci src/
  12. RUN cargo build -r -F mkl
  13. RUN rm -rf src
  14. COPY . .
  15. RUN cargo install --path . -F mkl
  16. RUN kuberian --ci
  17. FROM debian:bullseye-slim
  18. RUN apt update && \
  19. apt install -y libomp-dev && \
  20. rm -rf /var/lib/apt/lists/*
  21. ENV HF_HOME=/model
  22. COPY --from=builder /model /model
  23. COPY --from=builder /usr/local/cargo/bin/kuberian /usr/local/bin/kuberian
  24. EXPOSE 8080
  25. CMD ["kuberian"]