[英]How to add local python files as a library to python virtual environment the same way as pip install to Airflow Docker
FROM apache/airflow:latest-python3.8
COPY requirements.txt .
RUN pip install -r requirements.txt
First, check the answer here https://stackoverflow.com/a/56483981/11609051 for the installation of your package to the venv.首先,在这里查看https://stackoverflow.com/a/56483981/11609051的答案,以便将 package 安装到 venv。
After that you need to extend your docker image.之后,您需要扩展您的 docker 映像。 For this your Dockerfile.txt should be similar to:
为此,您的 Dockerfile.txt 应类似于:
FROM apache/airflow:2.4.0
WORKDIR /Users/Desktop/tools/airflow2.4-lite
COPY requirements.txt /requirements.txt
RUN pip install --user --upgrade pip
RUN pip install --no-cache-dir --user -r /requirements.txt
then you need to run command:那么你需要运行命令:
docker build . -f Dockerfile.txt
However there are some points that needs to be taken into account.但是,有一些点需要考虑。
pip3.8 install <package-name>
command.pip3.8 install <package-name>
命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.