-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·69 lines (56 loc) · 2.07 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
# VERSION 0.1.0
# AUTHOR: muru
FROM centos:7
## Core OS and dependencies install & configure
RUN yum -y update && \
yum -y install epel-release && \
yum -y install \
wget \
nmap-ncat \
python-pip \
python-devel \
krb5-devel \
cyrus-sasl \
cyrus-sasl-devel \
cyrus-sasl-gs2 \
cyrus-sasl-gssapi \
cyrus-sasl-lib \
cyrus-sasl-md5 \
cyrus-sasl-plain \
openssl-devel \
libffi-devel \
krb5-workstation \
which \
cronie-noanacron \
sudo &&\
yum -y groupinstall "Development Tools" && \
pip install --upgrade pip
RUN localedef --quiet -c -i en_US -f UTF-8 en_US.UTF-8
## Airflow install
ENV AIRFLOW_VERSION #AIRFLOW_VERSION#
ENV KUBECTL_VERSION #KUBECTL_VERSION#
ENV AIRFLOW_HOME /opt/airflow
#
RUN useradd --shell /bin/bash --create-home --home $AIRFLOW_HOME airflow \
&& mkdir $AIRFLOW_HOME/logs \
&& mkdir $AIRFLOW_HOME/dags \
&& mkdir $AIRFLOW_HOME/plugins \
&& chown -R airflow: $AIRFLOW_HOME \
&& pip install pytz==2015.7 cryptography pyOpenSSL ndg-httpsclient \
&& pip install pyasn1 psycopg2 celery==3.1.17 \
&& pip install --upgrade backports.ssl-match-hostname \
&& pip install configparser
RUN pip install "apache-airflow[celery, rabbitmq, postgres, async, password, crypto, kerberos, jdbc, docker]"
RUN curl -L -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl
# Entrypoint
ADD script/entrypoint.sh ${AIRFLOW_HOME}/entrypoint.sh
RUN chmod +x $AIRFLOW_HOME/entrypoint.sh
# Configuration
ADD config/airflow.cfg ${AIRFLOW_HOME}/airflow.cfg
RUN sed -i "s:#AIRFLOW_HOME#:$AIRFLOW_HOME:" $AIRFLOW_HOME/airflow.cfg
RUN FERNET_KEY=$(python -c "from cryptography.fernet import Fernet; FERNET_KEY = Fernet.generate_key().decode(); print FERNET_KEY") \
&& sed -i "s/#FERNET_KEY#/$FERNET_KEY/" $AIRFLOW_HOME/airflow.cfg
EXPOSE 8080 5555 8793
USER root
WORKDIR ${AIRFLOW_HOME}
ENTRYPOINT ["./entrypoint.sh"]