flymg opened a new issue #9248:
URL: https://github.com/apache/airflow/issues/9248


   **Description**
   
   The new production ready Docker images are not compatible out of the box for 
Openshift Deployment, as some Openshift key concepts where violated.
   
   Example:
   apache/airflow:1.10.10-python3.7
   
   **Use case / motivation**
   
   Reference: 
https://docs.openshift.com/container-platform/3.7/creating_images/guidelines.html
   - Image must be runnable with arbitrary userid
   - Image must be runnable without associated entry in /etc/passwd
   
   A Key Problem is the installation of python requirements as uid 50000 
(airflow).
   
   ** Workaround **
   
   ```Dockerfile
   FROM apache/airflow:1.10.10-python3.7
   
   # Airflow
   # ENV INIT_DAG="git_pull"
   
   ARG PYTHON_MAJOR_MINOR_VERSION="3.7"
   ENV PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION}
   
   # Modifications to the make image compatible with Openshifts Support 
Arbitrary User IDs
   # 
https://docs.openshift.com/container-platform/3.7/creating_images/guidelines.html
   USER root
   # directories to be modified
   RUN chgrp -R 0 /home/airflow && chmod -R g=u /home/airflow
   RUN chgrp -R 0 ${AIRFLOW_HOME} && chmod -R g=u ${AIRFLOW_HOME}
   
   # additionally, airflow users python site-packages must be available to 
arbitrary user as well
   # Reference: https://stackoverflow.com/a/7901603
   RUN echo 
"/home/airflow/.local/lib/python${PYTHON_MAJOR_MINOR_VERSION}/site-packages" > 
/usr/local/lib/python${PYTHON_MAJOR_MINOR_VERSION}/site-packages/airflow.pth
   
   RUN chmod g=u /etc/passwd
   ...
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to