I am using this https://github.com/tuanavu/airflow-tutorial git repo, to run airflow in a docker container, but along with it I want to install additional requirements.
I am trying to install git and few other dependencies for that I have created Dockerfile in the airflow-tutorial directory. and added below lines in the file.
RUN apt-get update && \
apt-get install -y git
RUN pip install dataclasses
then trying to build it with docker-compose up --build
but it keep failing and error is
ModuleNotFoundError: No module named 'dataclasses'
it works perfectly fine without my Dockerfile, Can any body please help me solve this issue?
Docker-compose.yml file
version: '3'
services:
postgres:
image: postgres:12.3
environment:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
ports:
- "5433:5432"
webserver:
image: puckel/docker-airflow:1.10.1
build:
context: https://github.com/puckel/docker-airflow.git#1.10.1
dockerfile: Dockerfile
args:
AIRFLOW_DEPS: gcp_api,s3
PYTHON_DEPS: sqlalchemy==1.2.0
restart: always
depends_on:
- postgres
environment:
- LOAD_EX=n
- EXECUTOR=Local
- FERNET_KEY=jsDPRErfv8Z_eVTnGfF8ywd19j4pyqE3NpdUBA_oRTo=
- SSH_AUTH_SOCK=/ssh-agent
volumes:
- /home/awaish/work/airflow/dags1:/usr/local/airflow/dags
- /usr/bin/ssh-agent:/ssh-agent
# Uncomment to include custom plugins
# - ./plugins:/usr/local/airflow/plugins
ports:
- "8080:8080"
command: webserver
healthcheck:
test: ["CMD-SHELL", "[ -f /usr/local/airflow/airflow-webserver.pid ]"]
interval: 30s
timeout: 30s
retries: 3
and Dockerfile
#WORKDIR /usr/src/app
FROM python3.7
RUN apt-get update && \
apt-get install -y git
RUN pip3 install dataclasses
RUN pip3 install git+ssh://git@bitbucket.org/myspace/utilities.git@master