1
- ARG PYTHON_VERSION=3.6
2
- FROM python:${PYTHON_VERSION}-slim as airflow-base
1
+ ARG AIRFLOW_VERSION=1.10.12
2
+ ARG PYTHON_VERSION=3.7
3
+ FROM apache/airflow:${AIRFLOW_VERSION}-python${PYTHON_VERSION}
3
4
4
- ENV AIRFLOW_BUILD_DEPS="freetds-dev python-dev libkrb5-dev libssl-dev libffi-dev libpq-dev git"
5
- ENV AIRFLOW_APT_DEPS="libsasl2-dev sasl2-bin libsasl2-2 libsasl2-dev libsasl2-modules freetds-bin build-essential default-libmysqlclient-dev apt-utils curl rsync netcat locales"
5
+ USER root
6
6
7
- ENV AIRFLOW_VERSION=1.10.5
8
- ENV AIRFLOW_HOME /usr/local/airflow
9
- ENV AIRFLOW_GPL_UNIDECODE=yes
10
- ENV SLUGIFY_USES_TEXT_UNIDECODE=yes
7
+ ARG AIRFLOW_VERSION=1.10.12
8
+ ENV AIRFLOW_VERSION=${AIRFLOW_VERSION}
9
+ # ENV AIRFLOW_HOME /usr/local/airflow
11
10
ENV WHIRL_SETUP_FOLDER=/etc/airflow/whirl.setup.d
12
11
13
12
SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
14
13
15
- RUN mkdir -p /usr/share/man/man1 \
16
- && update-ca-certificates -f \
17
- && apt-get update \
18
- && apt-get install -y --no-install-recommends --reinstall build-essential \
19
- && apt-get install -y --no-install-recommends --allow-unauthenticated \
20
- software-properties-common \
21
- wget \
22
- dnsutils \
23
- vim \
24
- git \
25
- default-libmysqlclient-dev \
26
- gcc \
27
- ${AIRFLOW_BUILD_DEPS} \
28
- ${AIRFLOW_APT_DEPS} \
29
- nginx \
30
- gosu \
31
- sudo \
32
- && apt-get clean \
33
- && apt-get autoremove -yqq --purge \
34
- && rm -rf /var/cache/apk/* /var/lib/apt/lists/* \
35
- && (find /usr/share/doc -type f -and -not -name copyright -print0 | xargs -0 -r rm)
36
-
37
- FROM airflow-base as main_image
38
-
39
- # Optimizing installation of Cassandra driver
40
- # Speeds up building the image - cassandra driver without CYTHON saves around 10 minutes
41
- ARG CASS_DRIVER_NO_CYTHON="1"
42
- # Build cassandra driver on multiple CPUs
43
- ARG CASS_DRIVER_BUILD_CONCURRENCY="8"
44
-
45
- ENV CASS_DRIVER_BUILD_CONCURRENCY=${CASS_DRIVER_BUILD_CONCURRENCY}
46
- ENV CASS_DRIVER_NO_CYTHON=${CASS_DRIVER_NO_CYTHON}
47
-
48
- # By default PIP install run without cache to make image smaller
49
- ARG PIP_NO_CACHE_DIR="true"
50
- ENV PIP_NO_CACHE_DIR=${PIP_NO_CACHE_DIR}
51
-
52
- RUN pip install --upgrade pip \
53
- && pip install apache-airflow[all_dbs,atlas,async,cassandra,celery,cgroups,cloudant,crypto,dask,databricks,datadog,doc,docker,druid,elasticsearch,gcp_api,github_enterprise,google_auth,hdfs,hive,jdbc,jira,kerberos,ldap,mongo,mssql,mysql,oracle,password,pinot,postgres,qds,rabbitmq,redis,salesforce,samba,sendgrid,segment,slack,snowflake,ssh,statsd,vertica,webhdfs,winrm]=="${AIRFLOW_VERSION}" \
54
- 'pymssql<3.0' \
55
- && mkdir -p "${AIRFLOW_HOME}/dags"
56
-
57
14
RUN mkdir -p "${WHIRL_SETUP_FOLDER}/env.d"
58
15
RUN mkdir -p "${WHIRL_SETUP_FOLDER}/dag.d"
59
16
@@ -75,18 +32,19 @@ RUN mkdir -p /etc/nginx/ssl \
75
32
COPY nginx-ssl.conf /etc/nginx/conf.d/
76
33
77
34
# Harden Image
78
- COPY harden.sh .
79
- RUN chmod +x harden.sh && \
80
- sh harden.sh airflow
35
+ # COPY harden.sh .
36
+ # RUN chmod +x harden.sh && \
37
+ # sh harden.sh airflow
81
38
82
- RUN chown -R airflow.airflow ${AIRFLOW_HOME}
39
+ RUN echo " airflow ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
83
40
USER airflow
84
41
85
42
EXPOSE 5000
86
43
87
- COPY --chown=airflow:airflow entrypoint.sh delete_all_airflow_connections.py /
44
+ COPY --chown=airflow:airflow entrypoint.sh /entrypoint-whirl.sh
88
45
COPY includes /etc/airflow/functions
89
46
COPY pip.conf /home/airflow/.config/pip/pip.conf
90
47
91
48
ENV PATH="${PATH}:/home/airflow/.local/bin"
92
- ENTRYPOINT ["/entrypoint.sh" ]
49
+ ENTRYPOINT ["/entrypoint-whirl.sh" ]
50
+ CMD ["airflow" , "--help" ]
0 commit comments