potiuk commented on issue #17320:
URL: https://github.com/apache/airflow/issues/17320#issuecomment-889403431


   1. Docker-Compose of Airlow is not production ready. You should use it only 
for development and testing, if you want more production setup I recommend to 
use the official Helm Chart of the communiy: 
https://airflow.apache.org/docs/helm-
   chart/stable/index.html and K8S. 
   
   2. If you mount your local folders as volumes to Airlfow, you should make 
sure that  you use your HOST_ID as user_id and GID=0 as user. This is very 
clear in the "Initialize the environment section of the docker compose" 
https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html#initializing-environment
 quick start documentation. Apparently you mised that step. so let me copy it 
here (you need to run it once in the host in the directory where you have 
docker compose.
   ```
   echo -e "AIRFLOW_UID=$(id -u)\nAIRFLOW_GID=0" > .env
   ```
   
   How it works - it changes the user that is used by Airflow to be the same as 
your host user, and sets the group ID to be 0 (which is the best practice 
followed from OpenShift to make possible to run container image as an arbitrary 
user).
   
   3.  No other configuration is supported for docker compose when you mount 
your local folder on linux. This is is a Docker limitation, not airflow nor 
image limitation.  Airflow image is defined according to best practices of 
OpenShift and allows to run as arbitrary user id (, but when you mount local 
volume from host, the user from your host volume is an owner. There are various 
ways YOU can deal with the problem when you run the container (one of the 
solutions is the very one that Airlfow proposes - where you can define and use 
HOST UID and GID=0 to run the image. You can read more here: 
https://airflow.apache.org/docs/docker-stack/entrypoint.html#allowing-arbitrary-user-to-run-the-container
    
   3. The solution you copied is to manually build image and there manually 
your UID as the user. Which (obviously) cannot be done in the public image, 
because we do not know your user id when we prepare the image and each user has 
a different UID. It's just impossible. 
   
   


-- 
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: [email protected]

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


Reply via email to