2022-04-11 18:38:26 +02:00
|
|
|
FROM python:3.9-slim as base
|
2021-10-30 21:35:30 +05:30
|
|
|
ENV AIRFLOW_HOME=/airflow
|
2021-08-03 01:24:50 +05:30
|
|
|
RUN apt-get update && \
|
2022-08-18 15:54:00 +05:30
|
|
|
apt-get install -y gcc libsasl2-modules libxml2 libsasl2-dev build-essential libssl-dev libffi-dev librdkafka-dev unixodbc-dev python3.9-dev openjdk-11-jre unixodbc freetds-dev freetds-bin tdsodbc libevent-dev wget openssl --no-install-recommends && \
|
2021-08-03 01:24:50 +05:30
|
|
|
rm -rf /var/lib/apt/lists/*
|
2022-04-11 18:38:26 +02:00
|
|
|
|
2022-07-24 17:24:35 +02:00
|
|
|
# Manually fix security vulnerability from curl
|
|
|
|
# - https://security.snyk.io/vuln/SNYK-DEBIAN11-CURL-2936229
|
|
|
|
# Add it back to the usual apt-get install once a fix for Debian is released
|
|
|
|
RUN wget https://curl.se/download/curl-7.84.0.tar.gz && \
|
|
|
|
tar -xvf curl-7.84.0.tar.gz && cd curl-7.84.0 && \
|
|
|
|
./configure --with-openssl && make && make install
|
|
|
|
|
2022-07-28 14:46:25 +02:00
|
|
|
|
2022-04-11 18:38:26 +02:00
|
|
|
FROM base as airflow
|
2022-07-28 14:46:25 +02:00
|
|
|
ENV AIRFLOW_VERSION=2.3.3
|
2022-08-25 20:49:20 +05:30
|
|
|
|
|
|
|
# install odbc driver
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y gnupg && \
|
|
|
|
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
|
|
|
|
curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
|
|
|
|
apt-get update && \
|
|
|
|
ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
2021-11-11 10:52:32 +05:30
|
|
|
ENV CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-3.9.txt"
|
2021-12-18 16:41:38 +01:00
|
|
|
# Add docker provider for the DockerOperator
|
|
|
|
RUN pip install "apache-airflow[docker]==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
|
2022-04-11 18:38:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
FROM airflow as apis
|
|
|
|
WORKDIR /openmetadata-airflow-apis
|
|
|
|
COPY openmetadata-airflow-apis /openmetadata-airflow-apis
|
|
|
|
|
|
|
|
RUN pip install "."
|
|
|
|
|
|
|
|
FROM apis as ingestion
|
|
|
|
WORKDIR /ingestion
|
2021-11-11 10:52:32 +05:30
|
|
|
COPY ingestion /ingestion
|
2021-12-18 16:41:38 +01:00
|
|
|
|
2022-05-02 16:09:44 +05:30
|
|
|
ARG INGESTION_DEPENDENCY=all
|
2022-08-08 10:43:17 +05:30
|
|
|
RUN pip install --upgrade ".[${INGESTION_DEPENDENCY}]"
|
2022-04-11 18:38:26 +02:00
|
|
|
|
2021-11-11 10:52:32 +05:30
|
|
|
RUN airflow db init
|
2022-05-11 07:36:33 +02:00
|
|
|
RUN cp -r /ingestion/airflow.cfg /airflow/airflow.cfg
|
2021-10-26 21:44:24 +05:30
|
|
|
RUN chmod 755 ingestion_dependency.sh
|
2021-11-03 20:48:52 +05:30
|
|
|
EXPOSE 8080
|
2021-11-11 10:52:32 +05:30
|
|
|
CMD [ "./ingestion_dependency.sh" ]
|