-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
78 lines (69 loc) · 1.85 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
78
FROM python:3.7-slim-buster
LABEL maintainer="pk13055"
LABEL inspired="https://github.com/puckel/docker-airflow/"
ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux
ENV AIRFLOW_HOME=/usr/local/airflow
ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LC_CTYPE en_US.UTF-8
ENV LC_MESSAGES en_US.UTF-8
ENV buildDeps=' \
freetds-dev \
libkrb5-dev \
libsasl2-dev \
libssl-dev \
libffi-dev \
libpq-dev \
librabbitmq-dev \
git \
'
# initial build installation
# will be removed later
RUN apt-get update -yqq \
&& apt-get upgrade -yqq \
&& apt-get install -yqq --no-install-recommends $buildDeps \
freetds-bin \
build-essential \
cmake \
autoconf \
apt-utils \
curl \
rsync \
netcat \
locales
# pip and main packages
RUN 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_HOME} airflow \
&& pip install -U pip setuptools wheel \
pip-tools \
pytz \
pyOpenSSL \
ndg-httpsclient \
pyasn1 \
pyamqp
# airflow specific config
WORKDIR ${AIRFLOW_HOME}
COPY requirements.* .
RUN pip-compile requirements.in > requirements.txt
RUN pip-sync
# package installation cleanup
RUN 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
WORKDIR ${AIRFLOW_HOME}
COPY --chown=airflow ./config/airflow/airflow.cfg .
COPY --chown=airflow ./entrypoint.sh .
COPY --chown=airflow ./dags .
USER airflow
WORKDIR ${AIRFLOW_HOME}
ENTRYPOINT ["./entrypoint.sh"]