From: Chen Qi <Qi.Chen@windriver.com>
To: meta-virtualization@lists.yoctoproject.org
Subject: [meta-virtualization][master-next][PATCH 2/3] container-host-config: provide /etc/containers/policy.json
Date: Sun, 19 Feb 2023 20:54:22 -0800 [thread overview]
Message-ID: <20230220045423.84802-2-Qi.Chen@windriver.com> (raw)
In-Reply-To: <20230220045423.84802-1-Qi.Chen@windriver.com>
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>
---
.../container-host-config/container-host-config.bb | 2 ++
.../container-host-config/policy.json | 7 +++++++
recipes-containers/cri-o/cri-o_git.bb | 1 +
recipes-containers/skopeo/skopeo_git.bb | 1 -
4 files changed, 10 insertions(+), 1 deletion(-)
create mode 100755 recipes-containers/container-host-config/container-host-config/policy.json
diff --git a/recipes-containers/container-host-config/container-host-config.bb b/recipes-containers/container-host-config/container-host-config.bb
index c762dea..c2f17bf 100644
--- a/recipes-containers/container-host-config/container-host-config.bb
+++ b/recipes-containers/container-host-config/container-host-config.bb
@@ -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
}
diff --git a/recipes-containers/container-host-config/container-host-config/policy.json b/recipes-containers/container-host-config/container-host-config/policy.json
new file mode 100755
index 0000000..bb26e57
--- /dev/null
+++ b/recipes-containers/container-host-config/container-host-config/policy.json
@@ -0,0 +1,7 @@
+{
+ "default": [
+ {
+ "type": "insecureAcceptAnything"
+ }
+ ]
+}
diff --git a/recipes-containers/cri-o/cri-o_git.bb b/recipes-containers/cri-o/cri-o_git.bb
index 9467cf1..2ae3303 100644
--- a/recipes-containers/cri-o/cri-o_git.bb
+++ b/recipes-containers/cri-o/cri-o_git.bb
@@ -57,6 +57,7 @@ inherit systemd
inherit go
inherit goarch
inherit pkgconfig
+inherit container-host
EXTRA_OEMAKE="BUILDTAGS=''"
diff --git a/recipes-containers/skopeo/skopeo_git.bb b/recipes-containers/skopeo/skopeo_git.bb
index 66168ca..4d062ed 100644
--- a/recipes-containers/skopeo/skopeo_git.bb
+++ b/recipes-containers/skopeo/skopeo_git.bb
@@ -82,7 +82,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() {
--
2.37.1
next prev parent reply other threads:[~2023-02-20 4:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-20 4:54 [meta-virtualization][master-next][PATCH 1/3] Revert "cri-o: install policy.json to avoid image pulling error" Chen Qi
2023-02-20 4:54 ` Chen Qi [this message]
2023-02-21 15:13 ` [meta-virtualization][master-next][PATCH 2/3] container-host-config: provide /etc/containers/policy.json Bruce Ashfield
2023-02-20 4:54 ` [meta-virtualization][master-next][PATCH 3/3] container-host-config: extend to native and nativesdk Chen Qi
2023-02-21 15:14 ` Bruce Ashfield
2023-02-21 15:14 ` [meta-virtualization][master-next][PATCH 1/3] Revert "cri-o: install policy.json to avoid image pulling error" Bruce Ashfield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230220045423.84802-2-Qi.Chen@windriver.com \
--to=qi.chen@windriver.com \
--cc=meta-virtualization@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.