You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/11/23 16:29:14 UTC

[GitHub] [airflow] gontcharovd commented on issue #8606: Deal with initial username/passwords in the production docker image

gontcharovd commented on issue #8606:
URL: https://github.com/apache/airflow/issues/8606#issuecomment-732272749


   > Well you can simply add a new service in the docker stack/compose to initialize it:
   > 
   > ```
   > version: '3.6'
   > services:
   >   init:
   >     image: apache/airflow:1.10.10
   >     environment:
   >       AIRFLOW__CORE__SQL_ALCHEMY_CONN: mysql://airflow:airflow@mysql:3306/airflow
   >     entrypoint: "airflow upgradedb && airflow create_user -f none -l none -u $USER -p $PASSWORD -e $EMAIL"
   >   mysql:
   >     image: mysql
   >     environment:
   >       DB_USER: airflow
   >       DB_PASSWORD: airflow
   >       DB_NAME: airflow
   > ```
   > 
   > I think something like this will do. It can be added to the entrypoint script also.
   > 
   > But you can initialize any database with a matching version airflow installation. To initialize my airflow db for the docker stack deployments I do the following
   > 
   > 1. Spin up the db
   > 2. Setup the env variables to connect to the DB in local (fernet key and sql_alchemy_conn)
   > 3. Init the db and create user from local environment
   >    4 Deploy the stack with everything initialized
   
   I have an issue with the `&&` in this line when I tried adding this init service to my docker-compose:
   
   ```entrypoint: "airflow upgradedb && airflow create_user -f none -l none -u $USER -p $PASSWORD -e $EMAIL"```
   
   Did you manage to get it working in your case?
   I'm still not clear on the recommended way to initialize usernames/passwords when running the containers the first time.
   
   Are there any new recommendations about this topic?


----------------------------------------------------------------
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:
users@infra.apache.org