@@ -247,12 +247,59 @@ 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+ SOURCE_REF={SOURCE_IMGREF}
256+
257+ # Create permissive policy.json (use /var/tmp since it's mounted into podman container)
258+ # Mount directory to /etc/containers so podman creates it if it doesn't exist
259+ POLICY_DIR=/var/tmp/bcvk-policy-dir
260+ mkdir -p "${POLICY_DIR}"
261+ trap 'rm -rf -- "${POLICY_DIR}"' EXIT
262+ cat > "${POLICY_DIR}/policy.json" <<'EOF'
263+ {
264+ "default": [
265+ {
266+ "type": "insecureAcceptAnything"
267+ }
268+ ],
269+ "transports": {
270+ "containers-storage": {
271+ "": [
272+ {
273+ "type": "insecureAcceptAnything"
274+ }
275+ ]
276+ },
277+ "docker": {
278+ "": [
279+ {
280+ "type": "insecureAcceptAnything"
281+ }
282+ ]
283+ },
284+ "docker-daemon": {
285+ "": [
286+ {
287+ "type": "insecureAcceptAnything"
288+ }
289+ ]
290+ }
291+ }
292+ }
293+ EOF
294+
250295 # Execute bootc installation, having the outer podman pull from
251296 # the virtiofs store on the host, as well as the inner bootc.
252297 # Mount /var/tmp into inner container to avoid cross-device link errors (issue #125)
253- export STORAGE_OPTS=additionalimagestore=${AIS}
298+ # Override /etc/containers/policy.json with permissive policy (mount directory so podman creates it if needed)
254299 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 \
300+ -v /var/lib/containers:/var/lib/containers -v /var/tmp:/var/tmp -v /dev:/dev -v "${AIS}:${AIS}" \
301+ -v "${POLICY_DIR}:/etc/containers:ro" \
302+ --security-opt label=type:unconfined_t \
256303 --env=STORAGE_OPTS \
257304 {INSTALL_LOG} \
258305 {SOURCE_IMGREF} \
0 commit comments