Dockerfile
# 一个简单例子
# FROM,基于 python 3.10 镜像
FROM python
# MAINTAINER, 维护者
MAINTAINER allen-lv <lvhl2@outlook.com>
# 更新 pip
RUN pip install --upgrade pip --index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 工作目录,详细见 https://yeasy.gitbook.io/docker_practice/image/dockerfile/workdir
WORKDIR /app
ADD ./requirements.txt /app
# 安装依赖 python
RUN pip3 install -r requirements.txt
#设置容器执行后自动执行的命令,这里main.py是我们自动化框架的执行入口文件
CMD ["python3", "main.py"]
build构建镜像文件
docker build -t lv_python_test:v2 .