@@ -114,13 +114,15 @@ RUN python3 -m venv /stackable/app \
114
114
&& if [ -n "$AUTHLIB" ]; then pip install Authlib==${AUTHLIB}; fi && \
115
115
pip install --no-cache-dir /tmp/opa_authorizer-0.1.0-py3-none-any.whl
116
116
117
+ COPY --from=statsd_exporter-builder /statsd_exporter/statsd_exporter /stackable/statsd_exporter
117
118
COPY superset/stackable/patches /patches
118
- RUN /patches/apply_patches.sh ${PRODUCT}
119
-
120
- WORKDIR /stackable
121
- RUN source /stackable/app/bin/activate && cyclonedx-py environment --schema-version 1.5 --outfile app/superset-${PRODUCT}.cdx.json
122
119
123
- COPY --from=statsd_exporter-builder /statsd_exporter/statsd_exporter /stackable/statsd_exporter
120
+ RUN <<EOF
121
+ /patches/apply_patches.sh ${PRODUCT}
122
+ cd /stackable
123
+ source /stackable/app/bin/activate && cyclonedx-py environment --schema-version 1.5 --outfile app/superset-${PRODUCT}.cdx.json
124
+ chmod --recursive g=u /stackable
125
+ EOF
124
126
125
127
# Final image
126
128
FROM stackable/image/vector
@@ -131,12 +133,12 @@ ARG RELEASE
131
133
ARG STACKABLE_USER_UID
132
134
133
135
LABEL name="Apache Superset" \
134
-
135
- vendor="Stackable GmbH" \
136
- version="${PRODUCT}" \
137
- release="${RELEASE}" \
138
- summary="The Stackable image for Apache Superset." \
139
- description="This image is deployed by the Stackable Operator for Apache Superset."
136
+
137
+ vendor="Stackable GmbH" \
138
+ version="${PRODUCT}" \
139
+ release="${RELEASE}" \
140
+ summary="The Stackable image for Apache Superset." \
141
+ description="This image is deployed by the Stackable Operator for Apache Superset."
140
142
141
143
ENV FLASK_APP="superset.app:create_app()" \
142
144
FLASK_ENV="production" \
@@ -145,6 +147,10 @@ ENV FLASK_APP="superset.app:create_app()" \
145
147
ENV PATH="${HOME}/app/bin:${PATH}" \
146
148
PYTHONPATH="${HOME}/app/pythonpath"
147
149
150
+ COPY superset/licenses /licenses
151
+
152
+ COPY --from=builder --chown=${STACKABLE_USER_UID}:0 /stackable/ ${HOME}/
153
+
148
154
RUN <<EOF
149
155
microdnf update
150
156
microdnf install \
@@ -157,22 +163,23 @@ microdnf install \
157
163
158
164
microdnf clean all
159
165
rm -rf /var/cache/yum
160
-
161
- # All files and folders owned by root group to support running as arbitrary users.
162
- # This is best practice as all container users will belong to the root group (0).
163
- chown -R "${STACKABLE_USER_UID}:0" /stackable
164
- chmod -R g=u /stackable
165
166
EOF
166
167
167
- COPY superset/licenses /licenses
168
+ # ----------------------------------------
169
+ # Checks
170
+ # This section is to run final checks to ensure the created final images
171
+ # adhere to several minimal requirements like:
172
+ # - check file permissions and ownerships
173
+ # ----------------------------------------
168
174
169
- COPY --from=builder --chown=${STACKABLE_USER_UID}:0 /stackable/ ${HOME}/
175
+ # Check that permissions and ownership in ${HOME} are set correctly
176
+ # This will fail and stop the build if any mismatches are found.
177
+ RUN <<EOF
178
+ /bin/check-permissions-ownership.sh ${HOME} ${STACKABLE_USER_UID} 0
179
+ EOF
170
180
171
181
# ----------------------------------------
172
- # Attention: We are changing the group of all files in /stackable directly above
173
- # If you do any file based actions (copying / creating etc.) below this comment you
174
- # absolutely need to make sure that the correct permissions are applied!
175
- # chown ${STACKABLE_USER_UID}:0
182
+ # Attention: Do not perform any file based actions (copying/creating etc.) below this comment because the permissions would not be checked.
176
183
# ----------------------------------------
177
184
178
185
USER ${STACKABLE_USER_UID}
0 commit comments