Skip to content

Commit 832ac83

Browse files
authored
add dockerfile to build dev image (#4091)
1 parent b176526 commit 832ac83

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

docker/Dockerfile_dev

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM nvidia/cuda:12.8.1-devel-ubuntu22.04 AS cu12.8
2+
3+
# environment variables
4+
ENV DEBIAN_FRONTEND=noninteractive \
5+
TZ=Etc/UTC \
6+
PATH=/opt/py3/bin:/root/.local/bin:${PATH} \
7+
TRITON_PTXAS_PATH=/usr/local/cuda/bin/ptxas
8+
9+
# Install dependencies and create python virtual environment
10+
RUN --mount=type=cache,target=/var/cache/apt \
11+
--mount=type=cache,target=/root/.cache \
12+
sed -i 's|http://archive.ubuntu.com|http://azure.archive.ubuntu.com|g' /etc/apt/sources.list && \
13+
apt-get update -y && \
14+
apt-get install -y --no-install-recommends \
15+
tzdata wget curl openssh-server ssh sudo git-core \
16+
libibverbs1 ibverbs-providers ibverbs-utils librdmacm1 \
17+
libibverbs-dev rdma-core libmlx5-1 libssl-dev pkg-config \
18+
vim rapidjson-dev libgoogle-glog-dev gdb cmake build-essential \
19+
python3-dev ninja-build htop tree jq unzip && \
20+
apt-get clean -y && \
21+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
22+
# install UV
23+
wget -qO- https://astral.sh/uv/install.sh | sh && \
24+
# create Python virtual environment
25+
uv venv -p python3.12 --seed /opt/py3
26+
27+
# Should be in the lmdeploy root directory when building docker image
28+
COPY . /opt/lmdeploy
29+
30+
WORKDIR /opt/lmdeploy
31+
32+
# install lmdeploy and its dependencies
33+
RUN --mount=type=cache,target=/root/.cache/uv \
34+
uv pip install -r requirements_cuda.txt --extra-index-url https://download.pytorch.org/whl/cu128 && \
35+
uv pip install -e .
36+
37+
RUN uv cache clean

0 commit comments

Comments
 (0)