Skip to content

Commit 52dc9f2

Browse files
committed
backport changes in main branch .rhdh/docker/Dockerfile to 1.6
Signed-off-by: Nick Boldt <[email protected]>
1 parent afa0600 commit 52dc9f2

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

.rhdh/docker/Dockerfile

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ RUN \
205205
-e "s/(\"Last Commit\": \"(.+)\")/\1, \"Build Time\": \"$now\"/" && \
206206
cat packages/app/src/build-metadata.json; echo
207207

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
209210

210211
RUN echo "=== EXPORT DYNAMIC PLUGINS (with --no-install) ==="; FAILED=0; "$YARN" export-dynamic --filter=./dynamic-plugins/wrappers/* || true; \
211212
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
220221
RUN echo "=== DELETE DYNAMIC PLUGINS/* (except dist/) from $(pwd) ==="; find dynamic-plugins -maxdepth 1 -mindepth 1 -type d -not -name dist -exec rm -Rf {} \;
221222

222223
# Stage 4 - Build the actual backend image and install production dependencies
223-
FROM skeleton AS cleanup
224+
# Upstream only
225+
# FROM skeleton AS cleanup
224226

225227
# 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
233238
RUN tar xzf "$TARBALL_PATH"/skeleton.tar.gz; tar xzf "$TARBALL_PATH"/bundle.tar.gz; \
234239
rm -f "$TARBALL_PATH"/skeleton.tar.gz "$TARBALL_PATH"/bundle.tar.gz
235240

@@ -305,8 +310,11 @@ RUN microdnf install -y python3.11 python3.11-pip python3.11-devel make cmake cp
305310
microdnf clean all
306311

307312
# 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
310318
COPY --from=build $CONTAINER_SOURCE/dynamic-plugins/dist/ ./dynamic-plugins/dist/
311319

312320
# RHIDP-4220 - make Konflux preflight and EC checks happy - [check-container] Create a directory named /licenses and include all relevant licensing

python/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)