Browse Source

package/containers-image-config: new package

The container/image repository is the standards regpository that drives
the image management in container tools, like podman or skopeo. Besides
a Go library, it also prodvides the template configuration files used
by those tools; those files can also serve as default ones.

Install those files instead of the canned ones we cary in podman, and
change podman to use this new package too.

The registry file needs a fixup, as it by default does not allow
searching unqualified images (i.e. those that do not contain a registry
name) in a default registry, for security reasons. However, the Docker
Hub is traditionally a registry that can be accessed without being
specified, so we make that possible.

As was noted in ebbaac08e3f4 (package/podman: new package), "[p]roviding
actual files is going to be use-case dependent, and interested parties
will have to provide their own config files, e.g. in a rootfs overlay."

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
Yann E. MORIN 1 month ago
parent
commit
4686ab975b

+ 1 - 0
package/Config.in

@@ -2844,6 +2844,7 @@ menu "System tools"
 	source "package/circus/Config.in"
 	source "package/circus/Config.in"
 	source "package/conmon/Config.in"
 	source "package/conmon/Config.in"
 	source "package/containerd/Config.in"
 	source "package/containerd/Config.in"
+	source "package/containers-image-config/Config.in"
 	source "package/coreutils/Config.in"
 	source "package/coreutils/Config.in"
 	source "package/cpulimit/Config.in"
 	source "package/cpulimit/Config.in"
 	source "package/cpuload/Config.in"
 	source "package/cpuload/Config.in"

+ 8 - 0
package/containers-image-config/Config.in

@@ -0,0 +1,8 @@
+config BR2_PACKAGE_CONTAINERS_IMAGE_CONFIG
+	bool "containers-image-config"
+	help
+	  Install default, minimalist configuration files used by the
+	  various tools dealing with containers images, like podman,
+	  skopeo...
+
+	  https://github.com/containers/image

+ 3 - 0
package/containers-image-config/containers-image-config.hash

@@ -0,0 +1,3 @@
+# Locally computed:
+sha256  afdbb1487571d4cc8974e11c72bc4e05043fb490cfc0581783789f414c64f87b  containers-image-config-v5.35.0-git4.tar.gz
+sha256  716a8b80635c394681e652823e1e42e411ad2d254e1f202403422d74f4b0b106  LICENSE

+ 25 - 0
package/containers-image-config/containers-image-config.mk

@@ -0,0 +1,25 @@
+################################################################################
+#
+# containers-image-config
+#
+################################################################################
+
+CONTAINERS_IMAGE_CONFIG_VERSION = v5.35.0
+CONTAINERS_IMAGE_CONFIG_SITE = https://github.com/containers/image
+CONTAINERS_IMAGE_CONFIG_SITE_METHOD = git
+
+CONTAINERS_IMAGE_CONFIG_LICENSE = Apache-2.0
+CONTAINERS_IMAGE_CONFIG_LICENSE_FILES = LICENSE
+
+define CONTAINERS_IMAGE_CONFIG_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0644 \
+		$(@D)/default-policy.json \
+		$(TARGET_DIR)/etc/containers/policy.json
+	$(INSTALL) -D -m 0644 \
+		$(@D)/registries.conf \
+		$(TARGET_DIR)/etc/containers/registries.conf
+	$(SED) '/^# unqualified-search-registries = .*/s//unqualified-search-registries = ["docker.io"]/' \
+		$(TARGET_DIR)/etc/containers/registries.conf
+endef
+
+$(eval $(generic-package))

+ 1 - 0
package/podman/Config.in

@@ -12,6 +12,7 @@ config BR2_PACKAGE_PODMAN
 	select BR2_PACKAGE_CA_CERTIFICATES  # runtime
 	select BR2_PACKAGE_CA_CERTIFICATES  # runtime
 	select BR2_PACKAGE_CGROUPFS_V2_MOUNT if !BR2_PACKAGE_CGROUPFS_MOUNT && !BR2_INIT_SYSTEMD  # runtime
 	select BR2_PACKAGE_CGROUPFS_V2_MOUNT if !BR2_PACKAGE_CGROUPFS_MOUNT && !BR2_INIT_SYSTEMD  # runtime
 	select BR2_PACKAGE_CONMON  # runtime
 	select BR2_PACKAGE_CONMON  # runtime
+	select BR2_PACKAGE_CONTAINERS_IMAGE_CONFIG  # runtime
 	select BR2_PACKAGE_LIBGPGME
 	select BR2_PACKAGE_LIBGPGME
 	select BR2_PACKAGE_LIBSECCOMP
 	select BR2_PACKAGE_LIBSECCOMP
 	select BR2_PACKAGE_NETAVARK  # runtime
 	select BR2_PACKAGE_NETAVARK  # runtime

+ 0 - 10
package/podman/podman.mk

@@ -99,16 +99,6 @@ define PODMAN_LINUX_CONFIG_FIXUPS
 	$(PODMAN_LINUX_CONFIG_FIXUPS_BTRFS)
 	$(PODMAN_LINUX_CONFIG_FIXUPS_BTRFS)
 endef
 endef
 
 
-define PODMAN_CONFIG
-	$(Q)$(INSTALL) -D -m 0644 \
-		$(PODMAN_PKGDIR)/policy.json \
-		$(TARGET_DIR)/etc/containers/policy.json
-	$(Q)$(INSTALL) -D -m 0644 \
-		$(PODMAN_PKGDIR)/registries.conf \
-		$(TARGET_DIR)/etc/containers/registries.conf
-endef
-PODMAN_POST_INSTALL_TARGET_HOOKS += PODMAN_CONFIG
-
 define PODMAN_HELPERS
 define PODMAN_HELPERS
 	$(Q)mkdir -p $(TARGET_DIR)/usr/libexec/podman
 	$(Q)mkdir -p $(TARGET_DIR)/usr/libexec/podman
 	$(Q)ln -sf ../../bin/aardvark-dns $(TARGET_DIR)/usr/libexec/podman/aardvark-dns
 	$(Q)ln -sf ../../bin/aardvark-dns $(TARGET_DIR)/usr/libexec/podman/aardvark-dns

+ 0 - 7
package/podman/policy.json

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

+ 0 - 1
package/podman/registries.conf

@@ -1 +0,0 @@
-unqualified-search-registries = ["docker.io"]