dockerfile之vllm大模型镜像构建
创始人
2024-11-14 15:35:48

基础镜像:nvidia/cuda:11.8.0-devel-ubuntu22.04
cuda:11.8
python:3.11
torch:2.1.2

构建命令:

sudo docker build -t vllm:v1 . 

dockerfile内容:

FROM nvidia/cuda:11.8.0-devel-ubuntu22.04  # 定义VLLM_VERSION变量并赋值 ARG VLLM_VERSION=0.4.0.post1  # 设置 metadata LABEL maintainer="None" LABEL version=${VLLM_VERSION} LABEL description=${VLLM_VERSION}"+cu118'  # 设置 minconda 的环境变量 ENV PATH="/root/miniconda3/bin:$PATH" ARG PATH="/root/miniconda3/bin:$PATH"  # 更改默认 shell && 设置 DNS && 设置 apt 清华源 && 安装 wget, unzip, vim, screen, curl RUN rm /bin/sh && ln -s /bin/bash /bin/sh && \     mv /etc/apt/sources.list /etc/apt/sources.list.bak && \     echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse" > /etc/apt/sources.list && \     echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse" >> /etc/apt/sources.list && \     echo "deb https://mirnors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse" >> /etc/apt/sources.list && \     echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse" >> /etc/apt/sources.list && \     apt-get update && \     apt-get install -y wget unzip vim screen curl  # 安装 miniconda RUN mkdir -p ~/miniconda3 && \     wget https://repo.anaconda.com/miniconda/Miniconda3-py311_24.1.2-0-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh && \     bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 && \     rm -rf ~/miniconda3/miniconda.sh && \     ~/miniconda3/bin/conda init bash && \     conda --version && \     python -V  #设置 pip 清华源并安装 vLLM, fschat, openai35 ARG PYTHON_VERSION=311 RUN ~/miniconda3/bin/python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \     ~/miniconda3/bin/python -m pip install https://github.com/vllm-project/vllm/releases/download/v${VLLM_VERSION}/vllm-${VLLM_VERSION}+cu118-cp${PYTHON_VERSION}-cp${PYTHON_VERSION}-manylinux1_x86_64.whl && \     ~/miniconda3/bin/python -m pip uninstall torch -y && \     ~/miniconda3/bin/python -m pip install torch==2.1.2 --index-url https://download.pytorch.org/whl/cu118 && \     # ~/miniconda3/bin/python -m pip uninstall cupy-cuda12x -y && \     # ~/miniconda3/bin/python -m pip install cupy-cuda11x==12.1 && \     ~/miniconda3/bin/python -m pip uninstall xformers -y && \     ~/miniconda3/bin/python -m pip install xformers==v0.0.23.post1 --index-url https://download.pytorch.org/whl/cu118 && \     ~/miniconda3/bin/python -m pip install "fschat[model_worker,webui]"==0.2.36 && \     ~/miniconda3/bin/python -m pip install openai  # 清理 pip 缓存 RUN ~/miniconda3/bin/python -m pip cache purge 

相关内容

热门资讯

裸辞做“一人公司”,我后悔了 去年这个时候,一位以色列程序员正在东南亚旅行。他顺手把一个在脑子里转了很久的想法做成了产品,一个让任...
南京建成国内首个Pre-6G试... 4月21日,2026全球6G技术与产业生态大会在南京开幕。全息互动技术展台前,一名远在北京的工作人员...
超梵求职受邀参加“2025抖音... 超梵求职受邀参加“2025抖音巨量引擎成人教育行业生态大会”,探讨分享优质内容传播,服务万千学员。 ...
摩托罗拉Razr 2026(R... IT之家 4 月 22 日消息,摩托罗拉宣布新一代 Razr 折叠手机将于 4 月 29 日在美国发...
库克卸任,特纳斯领航:苹果新纪... 苹果首席执行官蒂姆·库克将卸任,硬件工程主管约翰·特纳斯将接任,苹果公司今天宣布此事。 库克将在夏季...