video-retalking容器

本文详细描述了如何使用Dockerfile创建一个包含NVIDIACUDA11.1开发环境、Python3.8、pip和特定库的镜像,以及两个版本的生产镜像,其中一个添加了额外的CUDA文件和模型权重。
摘要由CSDN通过智能技术生成

Dockerfile文件

# 使用 NVIDIA CUDA 11.1 开发环境作为基础镜像
FROM nvcr.io/nvidia/cuda:11.1.1-cudnn8-runtime-ubuntu20.04

# 设置非交互式安装模式以避免某些命令在构建过程中暂停
ENV DEBIAN_FRONTEND=noninteractive

# 更新软件包列表
RUN apt-get update

# 安装 Python 3.8 和 pip
RUN apt-get install -y  software-properties-common 
RUN apt-get install -y wget
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get install -y  python3.8 && apt-get  install python3-pip -y && apt install git  -y   && apt-get install ffmpeg libsm6 libxext6  -y && apt-get install libgl1 -y && apt-get install -
y g++ && apt-get install -y gcc  &&  apt-get install -y cmake 

# 设置默认的 python 指令为 python3.8
RUN  cp   /usr/bin/python3.8  /usr/bin/python  
RUN  git clone https://github.com/vinthony/video-retalking.git && cd video-retalking && pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 -f https://download.pytorch.org/whl/torch_st
able.html && pip install -r requirements.txt

# 清理缓存以减小镜像体积
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# 设置工作目录(可根据需要更改)
WORKDIR /app

# (可选)设置容器启动时执行的命令
CMD ["python"]

##################
 

生产镜像

# 使用 NVIDIA CUDA 11.8 开发环境作为基础镜像
FROM video-retalking:latest 

# 设置非交互式安装模式以避免某些命令在构建过程中暂停
ENV DEBIAN_FRONTEND=noninteractive

# 更新软件包列表
RUN apt-get update

ADD cuda-11.1  /usr/local/cuda-11.1
ADD  video-retalking  /tools
ADD detection_Resnet50_Final.pth /usr/local/lib/python3.8/dist-packages/facexlib/weights/detection_Resnet50_Final.pth
ADD parsing_parsenet.pth  /usr/local/lib/python3.8/dist-packages/facexlib/weights/parsing_parsenet.pth 

# 安装 Python 3.8 和 pip
WORKDIR /app

# (可选)设置容器启动时执行的命令
CMD ["python"]

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值