Skip to content

Commit d5ba56d

Browse files
authored
Update Dockerfile
1 parent fd55197 commit d5ba56d

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,51 @@ ENV TZ=Asia/Shanghai
33
ENV DEBIAN_FRONTEND=noninteractive
44
COPY README.txt ./
55

6-
RUN apt update && apt install -y build-essential cmake ninja-build patchelf wget net-tools curl iputils-ping git git-lfs apt-utils
7-
RUN wget https://github.com/IAMJOYBO/ktransformers/raw/refs/heads/main/CUDA.sh && bash CUDA.sh
6+
# 安装基础环境
7+
RUN apt update && apt upgrade -y && apt install -y build-essential cmake ninja-build patchelf wget net-tools curl iputils-ping git git-lfs apt-utils
8+
9+
# 安装cmake、gcc、g++
810
RUN wget https://github.com/Kitware/CMake/releases/download/v4.0.1/cmake-4.0.1-linux-x86_64.sh && echo y | bash cmake-4.0.1-linux-x86_64.sh
11+
RUN apt install -y gcc g++ && apt list --installed | grep -E "gcc|g++|cmake"
12+
13+
# 安装CUDA、NVCC
14+
RUN wget https://github.com/IAMJOYBO/ktransformers/raw/refs/heads/main/CUDA_ENV.sh && bash CUDA_ENV.sh
915
RUN wget https://github.com/IAMJOYBO/ktransformers/raw/refs/heads/main/cuda-toolkit.sh && bash cuda-toolkit.sh
1016
RUN wget https://github.com/IAMJOYBO/ktransformers/raw/refs/heads/main/nvcc.sh && bash nvcc.sh
1117

18+
# 安装Conda环境
1219
RUN mkdir -p /app
1320
WORKDIR /app
1421
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && bash Miniconda3-latest-Linux-x86_64.sh -b -p /app/miniconda
1522
RUN /app/miniconda/bin/conda init
1623
ENV PATH=/app/miniconda/bin:$PATH
17-
1824
RUN echo yes | conda update conda
25+
26+
# 创建并激活Conda环境
1927
RUN echo yes | conda create --name ktransformers python=3.11
2028
SHELL ["conda", "run", "-n", "ktransformers", "/bin/bash", "-c"]
2129
RUN conda install -c conda-forge libstdcxx-ng && strings /app/miniconda/envs/ktransformers/lib/libstdc++.so.6 | grep GLIBCXX
2230
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
2331
RUN pip install packaging ninja cpufeature numpy
2432

33+
# 依赖环境部署
2534
RUN apt install -y libtbb-dev libssl-dev libcurl4-openssl-dev libaio1 libaio-dev libgflags-dev zlib1g-dev libfmt-dev libnuma-dev
2635

36+
# KTransformers环境部署
2737
RUN git clone https://github.com/kvcache-ai/ktransformers.git && cd ktransformers && git submodule update --init --recursive
2838
RUN /app/miniconda/envs/ktransformers/bin/python -m pip install -U pip && pip install -U wheel setuptools
2939
RUN cd ktransformers && bash install.sh
3040

41+
# 下载大模型配置
3142
RUN pip install huggingface_hub modelscope
3243
RUN huggingface-cli download deepseek-ai/DeepSeek-V2-Lite-Chat --exclude *.safetensors --local-dir /app/model/deepseek-ai/DeepSeek-V2-Lite-Chat
3344
RUN huggingface-cli download deepseek-ai/DeepSeek-V3-0324 --exclude *.safetensors --local-dir /app/model/deepseek-ai/DeepSeek-V3-0324
3445
RUN huggingface-cli download deepseek-ai/DeepSeek-R1 --exclude *.safetensors --local-dir /app/model/deepseek-ai/DeepSeek-R1
3546

47+
# 配置国内源
3648
RUN pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
3749
# RUN mkdir -p /app/index-tts && rm -rf /etc/apt/sources.list && rm -rf /etc/apt/sources.list.d/*ubuntu*
3850
# COPY sources-22.04.list /etc/apt/sources.list
3951

52+
# 启动命令
4053
CMD tail -f README.txt

0 commit comments

Comments
 (0)