@@ -205,7 +205,8 @@ RUN \
205
205
-e "s/(\" Last Commit\" : \" (.+)\" )/\1 , \" Build Time\" : \" $now\" /" && \
206
206
cat packages/app/src/build-metadata.json; echo
207
207
208
- RUN echo "=== YARN BUILD ===" ; "$YARN" build --filter=backend
208
+ # suppress git warnings about dubious ownership in repository at '/opt/app-root/src' when building the backend app
209
+ RUN echo "=== YARN BUILD BACKEND ===" ; git config --global --add safe.directory /opt/app-root/src; "$YARN" build --filter=backend
209
210
210
211
RUN echo "=== EXPORT DYNAMIC PLUGINS (with --no-install) ===" ; FAILED=0; "$YARN" export-dynamic --filter=./dynamic-plugins/wrappers/* || true; \
211
212
for d in /tmp/xfs-*; do if [[ -f ${d}/build.log ]]; then \
@@ -220,16 +221,20 @@ RUN echo "=== YARN COPY DYNAMIC PLUGINS in $(pwd) ==="; "$YARN" copy-dynamic-plu
220
221
RUN echo "=== DELETE DYNAMIC PLUGINS/* (except dist/) from $(pwd) ===" ; find dynamic-plugins -maxdepth 1 -mindepth 1 -type d -not -name dist -exec rm -Rf {} \;
221
222
222
223
# Stage 4 - Build the actual backend image and install production dependencies
223
- FROM skeleton AS cleanup
224
+ # Upstream only
225
+ # FROM skeleton AS cleanup
224
226
225
227
# Upstream only - copy the install dependencies from the build stage and context
226
- COPY --from=build $CONTAINER_SOURCE/yarn.lock \
227
- $CONTAINER_SOURCE/package.json \
228
- $CONTAINER_SOURCE/packages/backend/dist/skeleton.tar.gz \
229
- $CONTAINER_SOURCE/packages/backend/dist/bundle.tar.gz \
230
- ./
231
- ENV TARBALL_PATH=.
232
-
228
+ # COPY --from=build $CONTAINER_SOURCE/yarn.lock \
229
+ # $CONTAINER_SOURCE/package.json \
230
+ # ./
231
+ # COPY --from=build \
232
+ # $CONTAINER_SOURCE/packages/backend/dist/skeleton.tar.gz \
233
+ # $CONTAINER_SOURCE/packages/backend/dist/bundle.tar.gz \
234
+ # ./packages/backend/dist/
235
+
236
+ # unpack and remove tarballs
237
+ ENV TARBALL_PATH=./packages/backend/dist
233
238
RUN tar xzf "$TARBALL_PATH" /skeleton.tar.gz; tar xzf "$TARBALL_PATH" /bundle.tar.gz; \
234
239
rm -f "$TARBALL_PATH" /skeleton.tar.gz "$TARBALL_PATH" /bundle.tar.gz
235
240
@@ -305,8 +310,11 @@ RUN microdnf install -y python3.11 python3.11-pip python3.11-devel make cmake cp
305
310
microdnf clean all
306
311
307
312
# Upstream only - copy from cleanup stage
308
- COPY --from=cleanup --chown=1001:1001 $CONTAINER_SOURCE/ ./
309
- # Upstream only - copy embedded dynamic plugins from $CONTAINER_SOURCE
313
+ # COPY --from=cleanup --chown=1001:1001 $CONTAINER_SOURCE/ ./
314
+ # Downstream only - copy from build, not cleanup stage
315
+ COPY --from=build --chown=1001:1001 "$CONTAINER_SOURCE" / ./
316
+
317
+ # Copy embedded dynamic plugins from $CONTAINER_SOURCE
310
318
COPY --from=build $CONTAINER_SOURCE/dynamic-plugins/dist/ ./dynamic-plugins/dist/
311
319
312
320
# RHIDP-4220 - make Konflux preflight and EC checks happy - [check-container] Create a directory named /licenses and include all relevant licensing
0 commit comments