Airflow does not create user from Dockerfile bash entrypoint

Viewed 23

I don't understand why

airflow users create -u admin -p admin -e admin@admin.com -f admin -l admin -r Admin

from my entrypoint.sh does not create an airflow user.

entrypoint.sh is being executed from my Dockerfile

....
#execute the bash script
ENTRYPOINT [ "/entrypoint.sh" ]

The weird thing is that my sqlite, webserver and scheduler are initialized from the same bash file and they do present the expected behavior.

This is my entrypoint.sh:

#!/usr/bin/env bash

# initialize the database
airflow db init

# run the scheduler in the background
airflow scheduler 

# create the user
airflow users create -u admin -p admin -e admin@admin.com -f admin -l admin -r Admin

# run the webserver
exec airflow webserver

Since the above does not properly run, now I always have to docker exec into the container and create the user manually, which is undesirable.

Could you please shed some light on what is actually happening & how could I fix this? Thank you !

0 Answers
Related