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