You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/10/19 11:06:16 UTC
[GitHub] [airflow] stromal commented on issue #26881: Add example of dockerfile with creating new virtualenv
stromal commented on issue #26881:
URL: https://github.com/apache/airflow/issues/26881#issuecomment-1283832944
@HengKevin
1.) I would advise to add this line to the base docker-compose.yml file
```
AIRFLOW__CORE__ENABLE_XCOM_PICKLING: 'true'
```
2.) this is good Dockerfile example
```
FROM apache/airflow:2.4.1-python3.8
# ExternalPythonOperator
# Compulsory to switch parameter to use your own venve via ExternalPythonOperator
ENV PIP_USER=false
#python venv setup that you have created locally
RUN python3 -m venv /opt/airflow/venv1
# Install dependencies:
COPY airflow/requirements.txt .
# copy over folder that containes a my own local pip package
COPY airflow/my_own_pip_package_folder /opt/airflow/my_own_pip_package_folder
# copy over ahtever file
COPY my_file.py /opt/airflow/my_file.py
# install packages in my own docker virtual environemnt
RUN /opt/airflow/venv1/bin/pip install -r requirements.txt
RUN /opt/airflow/venv1/bin/pip install /opt/airflow/my_own_pip_package_folder
RUN /opt/airflow/venv1/bin/pip install 'apache-airflow==2.4.1' --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.4.1/constraints-3.8.txt"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org