container-host-config: provide /etc/containers/policy.json

The /etc/containers/policy.json[1] file is used to specify verification
policy. For now, we can see it's used by both cri-o and skopeo. To avoid
conflict, we use container-host-config to provide this file and make both
skopeo and cri-o depend on it.

[1] https://github.com/containers/image/blob/main/docs/containers-policy.json.5.md

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Chen Qi 2023-03-01 01:52:27 -08:00 committed by Bruce Ashfield
parent b861dd498d
commit a27ba1b77d
4 changed files with 10 additions and 1 deletions

View File

@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384
SRC_URI = " \
file://storage.conf \
file://registries.conf \
file://policy.json \
"
do_install() {
@ -15,4 +16,5 @@ do_install() {
install ${WORKDIR}/storage.conf ${D}/${sysconfdir}/containers/storage.conf
install ${WORKDIR}/registries.conf ${D}/${sysconfdir}/containers/registries.conf
install ${WORKDIR}/policy.json ${D}/${sysconfdir}/containers/policy.json
}

View File

@ -0,0 +1,7 @@
{
"default": [
{
"type": "insecureAcceptAnything"
}
]
}

View File

@ -57,6 +57,7 @@ inherit systemd
inherit go
inherit goarch
inherit pkgconfig
inherit container-host
EXTRA_OEMAKE="BUILDTAGS=''"

View File

@ -80,7 +80,6 @@ do_install() {
install -d ${D}/${sysconfdir}/containers
install ${S}/src/import/bin/skopeo ${D}/${sbindir}/
install ${S}/src/import/default-policy.json ${D}/${sysconfdir}/containers/policy.json
}
do_install:append:class-native() {