-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
78 lines (63 loc) · 2.1 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM python:3.7
ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux
# Airflow
ARG AIRFLOW_VERSION=1.10.12
ARG AIRFLOW_USER_HOME=/usr/local/airflow
ARG AIRFLOW_DEPS=""
ARG PYTHON_DEPS=""
ENV AIRFLOW_HOME=${AIRFLOW_USER_HOME}
RUN apt-get update -yqq \
&& apt-get upgrade -yqq \
&& apt-get install -yqq --no-install-recommends \
apt-utils \
freetds-bin \
build-essential \
apt-utils \
curl \
rsync \
locales \
vim \
libsasl2-dev \
python-dev \
libldap2-dev \
libssl-dev \
&& sed -i 's/^# en_US.UTF-8 UTF-8$/en_US.UTF-8 UTF-8/g' /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
&& useradd -ms /bin/bash -d ${AIRFLOW_USER_HOME} airflow \
&& pip install -U pip setuptools wheel \
&& pip install pytz \
&& pip install pyOpenSSL \
&& pip install ndg-httpsclient \
&& pip install pyasn1 \
&& pip install psycopg2 \
&& pip install flower \
&& pip install pyldap \
&& pip install ldap3 \
&& pip install apache-airflow[crypto,celery,redis,postgres,hive,jdbc,ldap,ssh${AIRFLOW_DEPS:+,}${AIRFLOW_DEPS}]==${AIRFLOW_VERSION} \
&& pip uninstall -y SQLAlchemy \
&& pip install SQLAlchemy==1.3.15 \
&& if [ -n "${PYTHON_DEPS}" ]; then pip install ${PYTHON_DEPS}; fi \
&& apt-get purge --auto-remove -yqq $buildDeps \
&& apt-get autoremove -yqq --purge \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc \
/usr/share/doc-base
ENV LOCAL_DB_FILE=$AIRFLOW_USER_HOME/airflow.db
ENV AIRFLOW__CORE__SQL_ALCHEMY_CONN=sqlite:///$LOCAL_DB_FILE
ADD airflow.cfg ${AIRFLOW_USER_HOME}/airflow.cfg
ADD entrypoint.sh ${AIRFLOW_USER_HOME}/entrypoint.sh
ADD ./ldap_ca.crt /etc/ca/ldap_ca.crt
ADD webserver_config.py ${AIRFLOW_USER_HOME}/webserver_config.py
RUN chown -R airflow: ${AIRFLOW_USER_HOME}
EXPOSE 8083
USER airflow
RUN chmod +x ${AIRFLOW_USER_HOME}/entrypoint.sh
WORKDIR ${AIRFLOW_USER_HOME}
ENTRYPOINT [ "./entrypoint.sh" ]