简介
由于最近这段时间Docker官方的python镜像中的apt-key过期了导致apt无法使用只能从原始的Ubuntu镜像开始构建python环境
Dockerfile
docker
FROM ubuntu:20.04 AS builder-image
# 将安装过程设置为非交互式防止卡死
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --no-install-recommends -y python3.9 python3.9-dev python3.9-venv python3-pip python3-wheel build-essential && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# 构建Opencv依赖库
RUN apt-get clean
RUN apt-get update
RUN apt-get install ffmpeg libsm6 libxext6 -y
CMD ["python3"]