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

๐Ÿ“Œ Introduction

The article discusses the issue of permission errors when attempting to install packages from GitHub while using the apache/airflow:2.10.2 Docker image. It presents a solution that involves temporarily switching to the root user to install โ€˜gitโ€™ and then reverting to the airflow user for further installations.

๐Ÿš€ Quick Start

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

๐Ÿ” Recap

  • Permission errors can occur with the apache/airflow:2.10.2 image when installing packages from GitHub.
  • To resolve this issue, install git as the root user before switching back to the airflow user.
  • The Dockerfile provided demonstrates the steps to perform these actions.

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

https://hsiangjenli.github.io/blog/note_airflow_docker_permission_error/

Author

Hsiang-Jen Li & ChatGPT-4o Mini

Posted on

2024-09-26

Updated on

2025-02-28

Licensed under