2022-09-08 12:48:07 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								FROM apache/airflow:2.3.3-python3.9
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-09 17:39:46 +05:30
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								USER root
							 | 
						
					
						
							
								
									
										
										
										
											2022-08-25 20:49:20 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								RUN curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-08 12:48:07 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Install Dependencies (listed in alphabetical order)
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-09 17:39:46 +05:30
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								RUN apt-get update \
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-08 12:48:07 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    && apt-get install -y build-essential \
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    default-libmysqlclient-dev \
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-08 12:48:07 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    freetds-bin \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    freetds-dev \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    gcc \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    gnupg \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    libevent-dev \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    libffi-dev \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    libpq-dev \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    librdkafka-dev \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    libsasl2-dev \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    libsasl2-modules \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    libssl-dev \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    libxml2 \
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    netcat \
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-08 12:48:07 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    openjdk-11-jre \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    openssl \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    postgresql \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    postgresql-contrib \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    tdsodbc \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unixodbc \
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    unixodbc-dev \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    vim \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    wget --no-install-recommends \
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-08 12:48:07 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    # Accept MSSQL ODBC License
							 | 
						
					
						
							
								
									
										
										
										
											2022-08-25 20:49:20 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    && ACCEPT_EULA=Y apt-get install -y msodbcsql18 \
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-09 17:39:46 +05:30
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    && rm -rf /var/lib/apt/lists/*
							 | 
						
					
						
							
								
									
										
										
										
											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
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								RUN apt-get update \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    && apt-get install -t bullseye-backports -y \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    curl \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    libpcre2-8-0 \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    postgresql-common \
							 | 
						
					
						
							
								
									
										
										
										
											2022-10-31 10:01:05 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    expat \
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-10 06:17:20 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    bind9
							 | 
						
					
						
							
								
									
										
										
										
											2022-10-27 15:10:04 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Required for Starting Ingestion Container in Docker Compose
							 | 
						
					
						
							
								
									
										
										
										
											2022-10-29 22:03:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								COPY --chown=airflow:0 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 /home/airflow/ingestion
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-10-29 22:03:37 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								COPY --chown=airflow:0 openmetadata-airflow-apis /home/airflow/openmetadata-airflow-apis
							 | 
						
					
						
							
								
									
										
										
										
											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
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Provide Execute Permissions to shell script
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								RUN chmod +x /opt/airflow/ingestion_dependency.sh
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-09 17:39:46 +05:30
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								USER airflow
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								ARG AIRFLOW_CONSTRAINTS_LOCATION="https://raw.githubusercontent.com/apache/airflow/constraints-2.3.3/constraints-3.9.txt"
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-09 17:39:46 +05:30
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Argument to provide for Ingestion Dependencies to install. Defaults to all
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-08 12:48:07 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								RUN pip install --upgrade pip
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								WORKDIR /home/airflow/openmetadata-airflow-apis
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								RUN pip install "."
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								WORKDIR /home/airflow/ingestion
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								ARG INGESTION_DEPENDENCY="all"
							 | 
						
					
						
							
								
									
										
										
										
											2022-11-11 10:12:23 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								RUN pip install ".[${INGESTION_DEPENDENCY}]"
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-08-30 23:55:46 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Uninstalling psycopg2-binary and installing psycopg2 instead 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# because the psycopg2-binary generates a architecture specific error 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# while authrenticating connection with the airflow, psycopg2 solves this error 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								RUN pip uninstall psycopg2-binary -y
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-08 12:48:07 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								RUN pip install psycopg2 mysqlclient
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Make required folders for openmetadata-airflow-apis
							 | 
						
					
						
							
								
									
										
										
										
											2022-09-19 09:20:54 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								RUN mkdir -p /opt/airflow/dag_generated_configs
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								EXPOSE 8080
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# This is required as it's responsible to create airflow.cfg file
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								RUN airflow db init && rm -f /opt/airflow/airflow.db
							 |