Basically, I want to build the docker-airflow:
I have the Dockerfile like:
FROM puckel/docker-airflow:1.10.6
COPY ./airflow_home/airflow.cfg /usr/local/airflow/airflow.cfg
...
I have the docker-compose.yml like:
version: "3.4"
services:
postgres:
image: "postgres:9.6"
container_name: "postgres"
environment:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
ports:
- "5432:5432"
volumes:
- './data/postgres:/var/lib/postgresql/data'
# comment initdb after you will have use it at first run
# set the client and processed log types here
initdb:
build: .
entrypoint: airflow initdb
entrypoint:
['python3', '/usr/local/airflow/__init__.py', '-C', '$Client', '-T', '$Types']
volumes:
- './airflow_home/packages:/usr/local/airflow/packages'
depends_on:
- postgres
And there is no other airflow library in the requirements.txt.
I always got the error when I did the:
docker-compose up webserver
The error is:
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "connection" does not exist
webserver_1 | LINE 2: FROM connection GROUP BY connection.conn_id
The "xxx" include log as well.
I originally thought the error would come from the different versions. But I make sure the version has been confirmed right. I used the airflow.cfg comes from the same version and modified the sql_connection with Postgres. The database in Postgres has also been created. Does anyone know how to fix that?