Skip to content

Commit 22cd72a

Browse files
Rolv-Apnesethcgwalters
authored andcommitted
Dockerfile: chmod 0555 /usr
This is a workaround until the filesystem package ships the correct permissions for /usr, to match the expected permissions for root. The chmod must be in the layer that creates /usr in the final image (the fetch stage COPY), because the union checkout in the merge drops metadata-only changes from later layers. Signed-off-by: Rolv Apneseth <rolv.apneseth@gmail.com>
1 parent 0a3e773 commit 22cd72a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎Dockerfile‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ RUN --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp <<EOF
108108
if [[ "${boot_type}" == "uki" ]]; then
109109
/target-rootfs/usr/bin/bootc container split-kernel-and-rootfs --rootfs /target-rootfs --output /kernel
110110
fi
111+
112+
# TODO: drop once https://src.fedoraproject.org/rpms/filesystem/pull-request/44 or equivalent
113+
# is widely available. For now, manually ensure that /usr has the correct permissions.
114+
# The COPY in the fetch stage below is the layer which creates /usr in the
115+
# final image, so its mode here is applied at directory creation and
116+
# survives the ostree union checkout, which only applies the metadata of
117+
# directories it creates. This also runs before the UKI is sealed in the
118+
# sealed-uki stage, so the embedded composefs digest matches this rootfs.
119+
chmod 0555 /target-rootfs/usr
111120
EOF
112121

113122
FROM scratch as fetch

0 commit comments

Comments
 (0)