Dockerfile 896 B

123456789101112131415161718192021
  1. FROM apache/airflow:2.3.0
  2. USER root
  3. RUN rm -rf /etc/apt/sources.list.d/*
  4. RUN sed -i "s@http://\(deb\|security\).debian.org@https://mirrors.aliyun.com@g" /etc/apt/sources.list
  5. RUN apt update && apt-get install -y gcc g++ python-dev libsasl2-dev
  6. ARG USERNAME=airflow
  7. ARG USER_UID=1000
  8. ARG USER_GID=$USER_UID
  9. # Create the user
  10. RUN groupadd --gid $USER_GID $USERNAME \
  11. # && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
  12. #
  13. # [Optional] Add sudo support. Omit if you don't need to install software after connecting.
  14. && apt-get update \
  15. && apt-get install -y sudo \
  16. && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
  17. && chmod 0440 /etc/sudoers.d/$USERNAME
  18. USER airflow
  19. RUN pip install apache-airflow-providers-cncf-kubernetes apache-airflow-providers-apache-spark apache-airflow-providers-apache-hive -i https://mirror.baidu.com/pypi/simple