Ubuntu下制作ComfyUI的镜像文件
1、创建名为comfyui-docker的文件夹,并创建Dockerfile文件,文件中的内容如下:
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y \
git \
curl \
wget \
ffmpeg \
libsm6 \
libxext6 \
libgl1 \
python3 \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
RUN git clone https://githubfast.com/comfyanonymous/ComfyUI.git .
RUN pip3 install --timeout 300 -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
EXPOSE 8188
CMD ["python3", "main.py","--listen","0.0.0.0","--port","8188"]
2、构建镜像:
docker build -t comfyui-cuda .
3、创建并启动容器:
docker run -it --rm -p 8188:8188 --gpus all --name comfyui comfyui-cuda
评论
发表评论