forked from EricLBuehler/mistral.rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.cuda-all
More file actions
40 lines (33 loc) · 1.39 KB
/
Copy pathDockerfile.cuda-all
File metadata and controls
40 lines (33 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# syntax=docker/dockerfile:1
#
# Thin CUDA runtime image. The prebuilt CUDA package (the `mistralrs` binary plus its bundled
# `lib/` and, for cutile builds, `bin/tileiras`) is staged into `dist/` by the release workflow
# and copied in - not compiled here. BASE_TAG selects the CUDA runtime matching the binary's
# toolkit. Build via .github/workflows/release.yml.
ARG BASE_TAG=13.1.2-cudnn
FROM nvidia/cuda:${BASE_TAG}-runtime-ubuntu22.04 AS runtime
SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
ARG DEBIAN_FRONTEND=noninteractive
RUN <<HEREDOC
apt-get update
apt-get install -y --no-install-recommends \
libomp-dev \
ca-certificates \
libssl-dev \
curl
rm -rf /var/lib/apt/lists/*
HEREDOC
# The binary carries rpath $ORIGIN/lib, so it finds its bundled CUDA libs beside it.
# TARGETARCH (amd64/arm64) is set by buildx; the release workflow stages dist/<arch>/.
ARG TARGETARCH
COPY dist/${TARGETARCH}/ /opt/mistralrs/
RUN ln -sf /opt/mistralrs/mistralrs /usr/local/bin/mistralrs && \
if [ -f /opt/mistralrs/bin/tileiras ]; then ln -sf /opt/mistralrs/bin/tileiras /usr/local/bin/tileiras; fi
# Chat templates for models that ship without one
COPY chat_templates /chat_templates
# hf-hub reads HF_HOME; mount a volume at /data to persist downloaded models
ENV HF_HOME=/data
# Default port of `mistralrs serve`
EXPOSE 1234
ENTRYPOINT ["mistralrs"]
CMD ["--help"]