-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile-alpine
78 lines (63 loc) · 2.26 KB
/
Dockerfile-alpine
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
78
#Airflow Image
FROM alpine:3.6
ENV AIRFLOW_HOME /home/airflow
ENV PACKAGES="\
mariadb-dev \
dumb-init \
musl \
linux-headers \
build-base \
ca-certificates \
python2 \
python2-dev \
py-setuptools \
openssh \
libffi-dev \
libxml2-dev \
libxslt-dev \
"
RUN echo \
# replacing default repositories with edge ones
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" > /etc/apk/repositories \
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \
#updating packages to avoid version issues
&& apk --update upgrade \
# Add the packages, with a CDN-breakage fallback if needed
&& apk add --no-cache $PACKAGES || \
(sed -i -e 's/dl-cdn/dl-4/g' /etc/apk/repositories && apk add --no-cache $PACKAGES) \
# make some useful symlinks that are expected to exist
&& if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python2.7 /usr/bin/python; fi \
&& if [[ ! -e /usr/bin/python-config ]]; then ln -sf /usr/bin/python2.7-config /usr/bin/python-config; fi \
&& if [[ ! -e /usr/bin/easy_install ]]; then ln -sf /usr/bin/easy_install-2.7 /usr/bin/easy_install; fi \
&& cd /home && mkdir airflow && cd airflow \
&& adduser -S airflow \
&& easy_install pip \
&& pip install --upgrade pip \
&& pip install Cython \
&& pip install pytz==2015.7 \
&& pip install jinja2==2.8.1 \
&& pip install cryptography \
&& pip install pyOpenSSL \
&& pip install ndg-httpsclient \
&& pip install pyasn1 \
&& pip install slackclient \
&& pip install ibm_db \
&& pip install flask-bcrypt \
&& pip install airflow[jdbc,password,mysql]==1.8.0 \
&& rm -rf \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc
COPY airflow.cfg ${AIRFLOW_HOME}/airflow.cfg
COPY set_auth.py /home/airflow/set_auth.py
COPY webserver_entrypoint.sh /home/airflow/webserver_entrypoint.sh
COPY scheduler_entrypoint.sh /home/airflow/scheduler_entrypoint.sh
RUN chown -R airflow: ${AIRFLOW_HOME}
RUN chmod 775 ${AIRFLOW_HOME}/webserver_entrypoint.sh
RUN chmod 775 ${AIRFLOW_HOME}/scheduler_entrypoint.sh
EXPOSE 8080
USER airflow
WORKDIR ${AIRFLOW_HOME}
#ENTRYPOINT ["/home/airflow/webserver_entrypoint.sh"]