Skip to content

Commit 20e2fed

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 20e2fed

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,10 @@ 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
228-
ARG baseconfigs=""
229228

230229
# Switch to a signed systemd-boot, if configured
231230
RUN --network=none --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp \
@@ -251,8 +250,10 @@ rm -rf /run/rhsm
251250

252251
EORUN
253252

254-
FROM base-penultimate-source as base-penultimate
253+
FROM base-source as base-penultimate-source
255254
ARG boot_type
255+
ARG variant
256+
ARG baseconfigs=""
256257

257258
# Configure the rootfs
258259
ARG rootfs=""
@@ -272,9 +273,14 @@ RUN --network=none --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp
272273
COPY --from=packaging /usr-extras/ /usr/
273274
# Clean up package manager caches
274275
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 \
276276
--mount=type=bind,from=packaging,src=/,target=/run/packaging <<EORUN
277277
/run/packaging/cleanup
278+
EORUN
279+
280+
FROM base-penultimate-source as base-penultimate
281+
RUN --network=none --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp \
282+
--mount=type=bind,from=base-penultimate-source,src=/,target=/run/base-penultimate-src \
283+
--mount=type=bind,from=packaging,src=/,target=/run/packaging <<EORUN
278284

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

0 commit comments

Comments
 (0)