[note] Fixing Git Installation Issues in apache/airflow:2.10.2 Docker Image

When using the apache/airflow:2.10.2 image to install packages from GitHub, a permission error may occur. The solution is to install git using the root user, then switch back to the airflow user to install the package.

1
2
3
4
5
6
7
8
FROM apache/airflow:slim-2.10.2

USER root
RUN apt-get update && apt-get install -y git

USER airflow
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt