@@ -13,7 +13,6 @@ FROM stackable/image/vector AS airflow-build-image
13
13
ARG PRODUCT
14
14
ARG PYTHON
15
15
ARG TARGETARCH
16
- ARG TARGETOS
17
16
18
17
COPY airflow/constraints-${PRODUCT}-python${PYTHON}.txt /tmp/constraints.txt
19
18
@@ -59,37 +58,40 @@ ARG PYTHON
59
58
ARG RELEASE
60
59
ARG TINI
61
60
ARG TARGETARCH
62
- ARG TARGETOS
63
61
ARG STACKABLE_USER_UID
64
62
65
63
LABEL name="Apache Airflow" \
66
- maintainer="info@stackastatsd_exporble .tech" \
64
+ maintainer="info@stackable .tech" \
67
65
vendor="Stackable GmbH" \
68
66
version="${PRODUCT}" \
69
67
release="${RELEASE}" \
70
68
summary="The Stackable image for Apache Airflow." \
71
69
description="This image is deployed by the Stackable Operator for Apache Airflow."
72
70
73
71
COPY airflow/licenses /licenses
74
-
75
72
COPY --chown=${STACKABLE_USER_UID}:0 airflow/stackable/utils/entrypoint.sh /entrypoint.sh
76
73
COPY --chown=${STACKABLE_USER_UID}:0 airflow/stackable/utils/run-airflow.sh /run-airflow.sh
77
74
75
+ ENV HOME=/stackable
76
+ ENV AIRFLOW_USER_HOME_DIR=/stackable
77
+ ENV PATH=$PATH:/bin:$HOME/app/bin
78
+ ENV AIRFLOW_HOME=$HOME/airflow
79
+
78
80
# Update image and install python
79
81
RUN <<EOF
80
82
microdnf update
81
- microdnf install
82
- ca-certificates
83
- cyrus-sasl
84
- git
85
- libpq
86
- openldap
87
- openldap-clients
88
- openssh-clients
89
- openssl-libs
90
- openssl-pkcs11
91
- python${PYTHON}
92
- socat
83
+ microdnf install \
84
+ ca-certificates \
85
+ cyrus-sasl \
86
+ git \
87
+ libpq \
88
+ openldap \
89
+ openldap-clients \
90
+ openssh-clients \
91
+ openssl-libs \
92
+ openssl-pkcs11 \
93
+ python${PYTHON} \
94
+ socat \
93
95
unixODBC
94
96
microdnf clean all
95
97
rm -rf /var/cache/yum
@@ -100,32 +102,22 @@ curl --fail -o /usr/bin/tini "https://repo.stackable.tech/repository/packages/ti
100
102
chmod a+x /entrypoint.sh
101
103
chmod a+x /run-airflow.sh
102
104
chmod +x /usr/bin/tini
103
- EOF
104
105
105
- ENV HOME=/stackable
106
- ENV AIRFLOW_USER_HOME_DIR=/stackable
107
- ENV PATH=$PATH:/bin:$HOME/app/bin
108
- ENV AIRFLOW_HOME=$HOME/airflow
109
-
110
- USER ${STACKABLE_USER_UID}
111
- WORKDIR /stackable
112
-
113
- COPY --from=airflow-build-image --chown=${STACKABLE_USER_UID}:0 /stackable/ ${HOME}/
114
- COPY --from=gitsync-image --chown=${STACKABLE_USER_UID}:0 /git-sync /stackable/git-sync
115
-
116
- RUN <<EOF
117
106
mkdir -pv ${AIRFLOW_HOME}
118
107
mkdir -pv ${AIRFLOW_HOME}/dags
119
108
mkdir -pv ${AIRFLOW_HOME}/logs
120
- EOF
121
109
122
- USER 0
123
- RUN <<EOF
124
- chgrp -R 0 /stackable
110
+ # All files and folders owned by root to support running as arbitrary users
111
+ # This is best practice as all users will belong to group `0`
112
+ chown -R ${STACKABLE_USER_UID}: 0 /stackable
125
113
chmod -R g=u /stackable
126
114
EOF
127
115
128
116
USER ${STACKABLE_USER_UID}
117
+ WORKDIR /stackable
118
+
119
+ COPY --from=airflow-build-image --chown=${STACKABLE_USER_UID}:0 /stackable/ ${HOME}/
120
+ COPY --from=gitsync-image --chown=${STACKABLE_USER_UID}:0 /git-sync /stackable/git-sync
129
121
130
122
ENTRYPOINT ["/usr/bin/tini" , "--" , "/run-airflow.sh" ]
131
123
CMD []
0 commit comments