@@ -247,12 +247,56 @@ impl ToDiskOpts {
247247 tty=--tty
248248 fi
249249
250+ export STORAGE_OPTS=additionalimagestore=${AIS}
251+
252+ # Workaround for issue #126: Override container policy to allow signature changes.
253+ # Some images (e.g., RHEL) have strict signature policies that prevent bootc install
254+ # from changing layer representation. We create a permissive policy.json in a temp
255+ # directory and mount only that file (not the entire /etc/containers directory) to
256+ # avoid overwriting other files that might exist in that directory.
257+ POLICY_DIR=$(mktemp -d)
258+ trap 'rm -rf -- "${POLICY_DIR}"' EXIT
259+ cat > "${POLICY_DIR}/policy.json" <<'EOF'
260+ {
261+ "default": [
262+ {
263+ "type": "insecureAcceptAnything"
264+ }
265+ ],
266+ "transports": {
267+ "containers-storage": {
268+ "": [
269+ {
270+ "type": "insecureAcceptAnything"
271+ }
272+ ]
273+ },
274+ "docker": {
275+ "": [
276+ {
277+ "type": "insecureAcceptAnything"
278+ }
279+ ]
280+ },
281+ "docker-daemon": {
282+ "": [
283+ {
284+ "type": "insecureAcceptAnything"
285+ }
286+ ]
287+ }
288+ }
289+ }
290+ EOF
291+
250292 # Execute bootc installation, having the outer podman pull from
251293 # the virtiofs store on the host, as well as the inner bootc.
252294 # Mount /var/tmp into inner container to avoid cross-device link errors (issue #125)
253- export STORAGE_OPTS=additionalimagestore=${AIS}
295+ # Override /etc/containers/policy.json with permissive policy (only mount the file, not the directory)
254296 podman run --rm -i ${tty} --privileged --pid=host --net=none -v /sys:/sys:ro \
255- -v /var/lib/containers:/var/lib/containers -v /var/tmp:/var/tmp -v /dev:/dev -v ${AIS}:${AIS} --security-opt label=type:unconfined_t \
297+ -v /var/lib/containers:/var/lib/containers -v /var/tmp:/var/tmp -v /dev:/dev -v "${AIS}:${AIS}" \
298+ --mount type=bind,source="${POLICY_DIR}/policy.json",target=/etc/containers/policy.json,readonly \
299+ --security-opt label=type:unconfined_t \
256300 --env=STORAGE_OPTS \
257301 {INSTALL_LOG} \
258302 {SOURCE_IMGREF} \
0 commit comments