Skip to content

Commit 667a0fd

Browse files
dockerfile: Separate layer for removing kernel + initrd
Baseconfigs tests were failing in CI because the initrd which had the expected baseconfigs was being deleted in the same layer it was being created in. Move the deletion to a completely separate layer Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent fa0221b commit 667a0fd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ COPY --from=update-generated-from-code /src/docs/src/*.schema.json /docs/src/
221221
# ----
222222

223223
# Perform all filesystem transformations except generating the sealed UKI (if configured)
224-
FROM base as base-penultimate-source
224+
FROM base as base-source
225225
ARG variant
226226
ARG bootloader
227227
ARG boot_type
@@ -251,7 +251,7 @@ rm -rf /run/rhsm
251251

252252
EORUN
253253

254-
FROM base-penultimate-source as base-penultimate
254+
FROM base-source as base-penultimate-source
255255
ARG boot_type
256256

257257
# Configure the rootfs
@@ -272,9 +272,14 @@ RUN --network=none --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp
272272
COPY --from=packaging /usr-extras/ /usr/
273273
# Clean up package manager caches
274274
RUN --network=none --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp \
275-
--mount=type=bind,from=base-penultimate-source,src=/,target=/run/base-penultimate-src \
276275
--mount=type=bind,from=packaging,src=/,target=/run/packaging <<EORUN
277276
/run/packaging/cleanup
277+
EORUN
278+
279+
FROM base-penultimate-source as base-penultimate
280+
RUN --network=none --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp \
281+
--mount=type=bind,from=base-penultimate-source,src=/,target=/run/base-penultimate-src \
282+
--mount=type=bind,from=packaging,src=/,target=/run/packaging <<EORUN
278283

279284
# Remove kernel + initrd if UKI
280285
if [[ "${boot_type}" == "uki" ]]; then

0 commit comments

Comments
 (0)