@@ -4,7 +4,7 @@ ARG GIT_SYNC
4
4
5
5
# For updated versions check https://github.com/kubernetes/git-sync/releases
6
6
# which should contain a image location (e.g. registry.k8s.io/git-sync/git-sync:v3.6.8)
7
- FROM oci.stackable.tech/sdp/git-sync:${GIT_SYNC} as gitsync-image
7
+ FROM oci.stackable.tech/sdp/git-sync:${GIT_SYNC} AS gitsync-image
8
8
9
9
FROM stackable/image/statsd_exporter AS statsd_exporter-builder
10
10
@@ -60,9 +60,10 @@ ARG RELEASE
60
60
ARG TINI
61
61
ARG TARGETARCH
62
62
ARG TARGETOS
63
+ ARG STACKABLE_USER_UID
63
64
64
65
LABEL name="Apache Airflow" \
65
- maintainer="info@stackable .tech" \
66
+ maintainer="info@stackastatsd_exporble .tech" \
66
67
vendor="Stackable GmbH" \
67
68
version="${PRODUCT}" \
68
69
release="${RELEASE}" \
@@ -71,50 +72,56 @@ LABEL name="Apache Airflow" \
71
72
72
73
COPY airflow/licenses /licenses
73
74
75
+ COPY --chown=${STACKABLE_USER_UID}:0 airflow/stackable/utils/entrypoint.sh /entrypoint.sh
76
+ COPY --chown=${STACKABLE_USER_UID}:0 airflow/stackable/utils/run-airflow.sh /run-airflow.sh
77
+
74
78
# Update image and install python
75
- RUN microdnf update && \
76
- microdnf install \
77
- ca-certificates \
78
- cyrus-sasl \
79
- git \
80
- libpq \
81
- openldap \
82
- openldap-clients \
83
- openssh-clients \
84
- openssl-libs \
85
- openssl-pkcs11 \
86
- python${PYTHON} \
87
- socat \
88
- unixODBC && \
89
- microdnf clean all && \
90
- rm -rf /var/cache/yum
79
+ RUN <<EOF
80
+ 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
93
+ unixODBC
94
+ microdnf clean all
95
+ rm -rf /var/cache/yum
96
+
97
+ # Get the correct `tini` binary for our architecture.
98
+ # It is used as an init alternative in the entrypoint
99
+ curl --fail -o /usr/bin/tini "https://repo.stackable.tech/repository/packages/tini/tini-${TINI}-${TARGETARCH}"
100
+ chmod a+x /entrypoint.sh
101
+ chmod a+x /run-airflow.sh
102
+ chmod +x /usr/bin/tini
103
+ EOF
91
104
92
105
ENV HOME=/stackable
93
106
ENV AIRFLOW_USER_HOME_DIR=/stackable
94
107
ENV PATH=$PATH:/bin:$HOME/app/bin
95
108
ENV AIRFLOW_HOME=$HOME/airflow
96
109
97
-
98
- # Get the correct `tini` binary for our architecture.
99
- # It is used as an init alternative in the entrypoint
100
- RUN mkdir -pv ${AIRFLOW_HOME} && \
101
- mkdir -pv ${AIRFLOW_HOME}/dags && \
102
- mkdir -pv ${AIRFLOW_HOME}/logs && \
103
- chown --recursive stackable:stackable ${AIRFLOW_HOME} && \
104
- curl --fail -o /usr/bin/tini "https://repo.stackable.tech/repository/packages/tini/tini-${TINI}-${TARGETARCH}"
105
-
106
- COPY airflow/stackable/utils/entrypoint.sh /entrypoint.sh
107
- COPY airflow/stackable/utils/run-airflow.sh /run-airflow.sh
108
- RUN chmod a+x /entrypoint.sh && \
109
- chmod a+x /run-airflow.sh && \
110
- chmod +x /usr/bin/tini
111
-
112
- COPY --from=airflow-build-image --chown=stackable:stackable /stackable/ ${HOME}/
113
- COPY --from=gitsync-image --chown=stackable:stackable /git-sync /stackable/git-sync
114
-
115
- USER stackable
110
+ USER ${STACKABLE_USER_UID}
116
111
WORKDIR /stackable
117
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
+ mkdir -pv ${AIRFLOW_HOME}
118
+ mkdir -pv ${AIRFLOW_HOME}/dags
119
+ mkdir -pv ${AIRFLOW_HOME}/logs
120
+
121
+ chgrp -R 0 /stackable
122
+ chmod -R g=u /stackable
123
+ EOF
124
+
118
125
ENTRYPOINT ["/usr/bin/tini" , "--" , "/run-airflow.sh" ]
119
126
CMD []
120
127
0 commit comments