Skip to content

Commit 87d1d0a

Browse files
cgwaltersjeckersb
authored andcommitted
build-sys: Remove previous bootc units
As soon as we went from a single binary to shipping systemd units, we can't just blindly `COPY /new /` as it will leak old files. In the end as the comment says we probably need to go to building packages eventually. Signed-off-by: Colin Walters <[email protected]>
1 parent 443011e commit 87d1d0a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,15 @@ RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/rooth
8787

8888
# The final image that derives from the original base and adds the release binaries
8989
FROM base
90-
# First, create a layer that is our new binaries.
90+
RUN <<EORUN
91+
set -xeuo pipefail
92+
# Ensure we've flushed out prior state (i.e. files no longer shipped from the old version);
93+
# and yes, we may need to go to building an RPM in this Dockerfile by default.
94+
rm -vf /usr/lib/systemd/system/multi-user.target.wants/bootc-*
95+
EORUN
96+
# Create a layer that is our new binaries
9197
COPY --from=build /out/ /
98+
# We have code in the initramfs so we always need to regenerate it
9299
RUN <<EORUN
93100
set -xeuo pipefail
94101
if test -x /usr/lib/bootc/initramfs-setup; then

0 commit comments

Comments
 (0)