| 
									
										
										
										
											2023-12-19 11:09:38 +01:00
										 |  |  | FROM apache/airflow:2.7.3-python3.10
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  | USER root
 | 
					
						
							| 
									
										
										
										
											2023-08-02 14:36:27 +02:00
										 |  |  | RUN curl -sS https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
 | 
					
						
							|  |  |  | RUN curl -sS https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  | # Install Dependencies (listed in alphabetical order)
 | 
					
						
							| 
									
										
										
										
											2023-08-02 14:36:27 +02:00
										 |  |  | ENV DEBIAN_FRONTEND=noninteractive | 
					
						
							|  |  |  | RUN apt-get -qq update \
 | 
					
						
							|  |  |  |     && apt-get -qq install -y \
 | 
					
						
							|  |  |  |     alien \
 | 
					
						
							| 
									
										
										
										
											2023-01-19 08:08:56 +01:00
										 |  |  |     build-essential \
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  |     default-libmysqlclient-dev \
 | 
					
						
							|  |  |  |     freetds-bin \
 | 
					
						
							|  |  |  |     freetds-dev \
 | 
					
						
							|  |  |  |     gcc \
 | 
					
						
							|  |  |  |     gnupg \
 | 
					
						
							| 
									
										
										
										
											2023-01-19 08:08:56 +01:00
										 |  |  |     libaio1 \
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  |     libevent-dev \
 | 
					
						
							|  |  |  |     libffi-dev \
 | 
					
						
							|  |  |  |     libpq-dev \
 | 
					
						
							|  |  |  |     librdkafka-dev \
 | 
					
						
							|  |  |  |     libsasl2-dev \
 | 
					
						
							| 
									
										
										
										
											2023-05-16 14:32:48 +02:00
										 |  |  |     libsasl2-2 \
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  |     libsasl2-modules \
 | 
					
						
							| 
									
										
										
										
											2023-05-16 14:32:48 +02:00
										 |  |  |     libsasl2-modules-gssapi-mit \
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  |     libssl-dev \
 | 
					
						
							|  |  |  |     libxml2 \
 | 
					
						
							| 
									
										
										
										
											2023-04-20 10:56:46 +02:00
										 |  |  |     libkrb5-dev \
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  |     openjdk-11-jre \
 | 
					
						
							|  |  |  |     openssl \
 | 
					
						
							|  |  |  |     postgresql \
 | 
					
						
							|  |  |  |     postgresql-contrib \
 | 
					
						
							|  |  |  |     tdsodbc \
 | 
					
						
							|  |  |  |     unixodbc \
 | 
					
						
							|  |  |  |     unixodbc-dev \
 | 
					
						
							| 
									
										
										
										
											2023-01-19 08:08:56 +01:00
										 |  |  |     unzip \
 | 
					
						
							| 
									
										
										
										
											2023-10-06 11:51:07 +07:00
										 |  |  |     git \
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  |     wget --no-install-recommends \
 | 
					
						
							|  |  |  |     # Accept MSSQL ODBC License
 | 
					
						
							|  |  |  |     && ACCEPT_EULA=Y apt-get install -y msodbcsql18 \
 | 
					
						
							|  |  |  |     && rm -rf /var/lib/apt/lists/*
 | 
					
						
							| 
									
										
										
										
											2022-10-27 15:10:04 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-19 08:08:56 +01:00
										 |  |  | RUN if [[ $(uname -m) == "arm64" || $(uname -m) == "aarch64" ]]; \
 | 
					
						
							|  |  |  |  then \
 | 
					
						
							| 
									
										
										
										
											2023-08-02 14:36:27 +02:00
										 |  |  |  wget -q https://download.oracle.com/otn_software/linux/instantclient/191000/instantclient-basic-linux.arm64-19.10.0.0.0dbru.zip -O /oracle-instantclient.zip && \
 | 
					
						
							|  |  |  |  unzip -qq -d /instantclient -j /oracle-instantclient.zip && rm -f /oracle-instantclient.zip; \
 | 
					
						
							| 
									
										
										
										
											2023-01-19 08:08:56 +01:00
										 |  |  |  else \
 | 
					
						
							| 
									
										
										
										
											2023-08-02 14:36:27 +02:00
										 |  |  |  wget -q https://download.oracle.com/otn_software/linux/instantclient/1917000/instantclient-basic-linux.x64-19.17.0.0.0dbru.zip -O /oracle-instantclient.zip && \
 | 
					
						
							|  |  |  |  unzip -qq -d /instantclient -j /oracle-instantclient.zip && rm -f /oracle-instantclient.zip; \
 | 
					
						
							| 
									
										
										
										
											2023-01-19 08:08:56 +01:00
										 |  |  |  fi
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ENV LD_LIBRARY_PATH=/instantclient
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-27 15:10:04 +02:00
										 |  |  | # Security patches for base image
 | 
					
						
							|  |  |  | # monitor no fixed version for
 | 
					
						
							|  |  |  | #    https://security.snyk.io/vuln/SNYK-DEBIAN11-LIBTASN16-3061097
 | 
					
						
							|  |  |  | #    https://security.snyk.io/vuln/SNYK-DEBIAN11-MARIADB105-2940589
 | 
					
						
							|  |  |  | #    https://security.snyk.io/vuln/SNYK-DEBIAN11-BIND9-3027852
 | 
					
						
							|  |  |  | #    https://security.snyk.io/vuln/SNYK-DEBIAN11-EXPAT-3023031 we are already installed the latest
 | 
					
						
							|  |  |  | RUN echo "deb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list
 | 
					
						
							| 
									
										
										
										
											2023-08-02 14:36:27 +02:00
										 |  |  | RUN apt-get -qq update \
 | 
					
						
							|  |  |  |     && apt-get -qq install -t bullseye-backports -y \
 | 
					
						
							| 
									
										
										
										
											2022-10-27 15:10:04 +02:00
										 |  |  |     curl \
 | 
					
						
							|  |  |  |     libpcre2-8-0 \
 | 
					
						
							|  |  |  |     postgresql-common \
 | 
					
						
							| 
									
										
										
										
											2022-10-31 09:25:44 +01:00
										 |  |  |     expat \
 | 
					
						
							| 
									
										
										
										
											2023-08-02 14:36:27 +02:00
										 |  |  |     bind9 \
 | 
					
						
							|  |  |  |     && rm -rf /var/lib/apt/lists/*
 | 
					
						
							| 
									
										
										
										
											2022-10-27 15:10:04 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  | # Required for Starting Ingestion Container in Docker Compose
 | 
					
						
							| 
									
										
										
										
											2023-08-02 14:36:27 +02:00
										 |  |  | COPY --chown=airflow:0 --chmod=775 ingestion/ingestion_dependency.sh /opt/airflow
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  | # Required for Ingesting Sample Data
 | 
					
						
							| 
									
										
										
										
											2022-10-29 22:03:37 +02:00
										 |  |  | COPY --chown=airflow:0 ingestion/examples/sample_data /home/airflow/ingestion/examples/sample_data
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  | # Required for Airflow DAGs of Sample Data
 | 
					
						
							| 
									
										
										
										
											2022-10-29 22:03:37 +02:00
										 |  |  | COPY --chown=airflow:0 ingestion/examples/airflow/dags /opt/airflow/dags
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  | USER airflow
 | 
					
						
							|  |  |  | # Argument to provide for Ingestion Dependencies to install. Defaults to all
 | 
					
						
							|  |  |  | ARG INGESTION_DEPENDENCY="all"
 | 
					
						
							| 
									
										
										
										
											2023-08-02 14:36:27 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Disable pip cache dir
 | 
					
						
							|  |  |  | # https://pip.pypa.io/en/stable/topics/caching/#avoiding-caching
 | 
					
						
							|  |  |  | ENV PIP_NO_CACHE_DIR=1 | 
					
						
							|  |  |  | # Make pip silent
 | 
					
						
							|  |  |  | ENV PIP_QUIET=1 | 
					
						
							| 
									
										
										
										
											2023-11-17 11:33:47 +05:30
										 |  |  | ARG RI_VERSION="1.3.0.0.dev0"
 | 
					
						
							| 
									
										
										
										
											2022-08-30 23:55:46 +02:00
										 |  |  | RUN pip install --upgrade pip
 | 
					
						
							| 
									
										
										
										
											2023-12-19 11:09:38 +01:00
										 |  |  | RUN pip install "openmetadata-managed-apis~=${RI_VERSION}" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.7.3/constraints-3.10.txt"
 | 
					
						
							| 
									
										
										
										
											2023-09-13 11:40:28 +02:00
										 |  |  | RUN pip install "openmetadata-ingestion[${INGESTION_DEPENDENCY}]~=${RI_VERSION}"
 | 
					
						
							| 
									
										
										
										
											2023-05-30 07:06:48 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Temporary workaround for https://github.com/open-metadata/OpenMetadata/issues/9593
 | 
					
						
							| 
									
										
										
										
											2023-06-05 10:43:52 +05:30
										 |  |  | RUN echo "Image built for $(uname -m)"
 | 
					
						
							| 
									
										
										
										
											2023-06-26 19:04:55 +05:30
										 |  |  | RUN if [[ $(uname -m) == "arm64" ]]; \
 | 
					
						
							| 
									
										
										
										
											2023-06-05 10:43:52 +05:30
										 |  |  |  then \
 | 
					
						
							|  |  |  |  pip install "ibm-db-sa~=0.4"; \
 | 
					
						
							|  |  |  |  fi
 | 
					
						
							| 
									
										
										
										
											2023-05-30 07:06:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-08 09:59:57 +02:00
										 |  |  | # bump python-daemon for https://github.com/apache/airflow/pull/29916
 | 
					
						
							|  |  |  | RUN pip install "python-daemon>=3.0.0"
 | 
					
						
							| 
									
										
										
										
											2022-12-16 15:46:25 +01:00
										 |  |  | # remove all airflow providers except for docker
 | 
					
						
							| 
									
										
										
										
											2022-12-27 20:15:46 +05:30
										 |  |  | RUN pip freeze | grep "apache-airflow-providers" | grep -v "docker\|http" | xargs pip uninstall -y
 | 
					
						
							| 
									
										
										
										
											2022-08-30 23:55:46 +02:00
										 |  |  | # Uninstalling psycopg2-binary and installing psycopg2 instead 
 | 
					
						
							|  |  |  | # because the psycopg2-binary generates a architecture specific error 
 | 
					
						
							| 
									
										
										
										
											2023-12-19 11:09:38 +01:00
										 |  |  | # while authenticating connection with the airflow, psycopg2 solves this error
 | 
					
						
							| 
									
										
										
										
											2022-08-30 23:55:46 +02:00
										 |  |  | RUN pip uninstall psycopg2-binary -y
 | 
					
						
							| 
									
										
										
										
											2023-06-22 15:18:39 +05:30
										 |  |  | RUN pip install psycopg2 mysqlclient==2.1.1
 | 
					
						
							| 
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 |  |  | # Make required folders for openmetadata-airflow-apis
 | 
					
						
							|  |  |  | RUN mkdir -p /opt/airflow/dag_generated_configs
 | 
					
						
							|  |  |  | # This is required as it's responsible to create airflow.cfg file
 | 
					
						
							|  |  |  | RUN airflow db init && rm -f /opt/airflow/airflow.db
 |