All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virtualization][PATCH 0/2] docker-moby, container-registry: fix check-config and registry defaults
@ 2026-11-29 21:48 John Madieu
  2026-11-29 21:48 ` [meta-virtualization][PATCH 1/2] docker-moby: drop the check-config patch for MEMCG_SWAP John Madieu
  2026-11-29 21:48 ` [meta-virtualization][PATCH 2/2] container-registry: default to insecure only without a secure registry John Madieu
  0 siblings, 2 replies; 6+ messages in thread
From: John Madieu @ 2026-11-29 21:48 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, John Madieu

Hi all,

This series fixes two problems that are in master and master-next. I
found them while building Docker, Podman and containerd hosts for
qemuarm64 with the wrynose branch, which has the same code.

The first drops the check-config patch for MEMCG_SWAP. Its hunk no
longer lands on the MEMCG_SWAP check, and the installed
/usr/share/docker/check-config.sh stops with a syntax error after the
optional features.

The second makes CONTAINER_REGISTRY_SECURE = "1" sufficient to select a
TLS registry, as the header of container-registry.conf says. Today the
fragment leaves CONTAINER_REGISTRY_INSECURE at "1", and parsing stops
with "CONTAINER_REGISTRY_SECURE and CONTAINER_REGISTRY_INSECURE cannot
both be set to '1'".

Tested on master-next with OE-core master, and on the wrynose branch,
with a qemuarm64 Docker host that sets CONTAINER_REGISTRY_SECURE = "1"
and leaves CONTAINER_REGISTRY_INSECURE unset: parsing succeeds, docker
pull works over HTTPS against the CA installed in /etc/docker/certs.d,
and check-config.sh runs to the end, through its network, storage and
limits sections.

Thanks,
John

John Madieu (2):
  docker-moby: drop the check-config patch for MEMCG_SWAP
  container-registry: default to insecure only without a secure registry

 conf/distro/include/container-registry.conf   |  2 +-
 recipes-containers/docker/docker-moby_git.bb  |  1 -
 ...g-make-CONFIG_MEMCG_SWAP-conditional.patch | 55 -------------------
 3 files changed, 1 insertion(+), 57 deletions(-)
 delete mode 100644 recipes-containers/docker/files/0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch


base-commit: 89b00d096a432000766729cd721ae647af500112
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [meta-virtualization][PATCH 1/2] docker-moby: drop the check-config patch for MEMCG_SWAP
  2026-11-29 21:48 [meta-virtualization][PATCH 0/2] docker-moby, container-registry: fix check-config and registry defaults John Madieu
@ 2026-11-29 21:48 ` John Madieu
  2026-11-30  5:04   ` Bruce Ashfield
  2026-11-29 21:48 ` [meta-virtualization][PATCH 2/2] container-registry: default to insecure only without a secure registry John Madieu
  1 sibling, 1 reply; 6+ messages in thread
From: John Madieu @ 2026-11-29 21:48 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, John Madieu

check-config.sh of docker-v29 only checks MEMCG_SWAP on kernels older
than 5.8, so the patch that skipped that check on 6.1+ kernels has
nothing left to do.

When the patch was refreshed for docker-v29.0.0-rc.1, its hunk moved
onto the CGROUP_PIDS check, where it opens an if in one { } block and
closes it with fi in the next. The installed check-config.sh stops
with a syntax error after the optional features, before the network
and storage driver checks.

Drop the patch.

Signed-off-by: John Madieu <john.madieu@gmail.com>
---
 recipes-containers/docker/docker-moby_git.bb  |  1 -
 ...g-make-CONFIG_MEMCG_SWAP-conditional.patch | 55 -------------------
 2 files changed, 56 deletions(-)
 delete mode 100644 recipes-containers/docker/files/0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch

diff --git a/recipes-containers/docker/docker-moby_git.bb b/recipes-containers/docker/docker-moby_git.bb
index 271f006e..ed944a69 100644
--- a/recipes-containers/docker/docker-moby_git.bb
+++ b/recipes-containers/docker/docker-moby_git.bb
@@ -53,7 +53,6 @@ SRC_URI = "\
 	file://docker.init \
         file://0001-cli-use-external-GO111MODULE-and-cross-compiler.patch \
         file://0001-dynbinary-use-go-cross-compiler.patch;patchdir=src/import \
-        file://0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch;patchdir=src/import \
 	"
 
 DOCKER_COMMIT = "${SRCREV_moby}"
diff --git a/recipes-containers/docker/files/0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch b/recipes-containers/docker/files/0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch
deleted file mode 100644
index b7fe5775..00000000
--- a/recipes-containers/docker/files/0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 28c115da3c6c2e6edda08c30a779f1ffaab2fbc7 Mon Sep 17 00:00:00 2001
-From: Bruce Ashfield <bruce.ashfield@gmail.com>
-Date: Fri, 18 Oct 2024 18:27:16 +0000
-Subject: [PATCH] check-config: make CONFIG_MEMCG_SWAP conditional
-
-Kernel's equal to or greater than 6.1 no longer have this
-option. See this kernel commit:
-
-   commit e55b9f96860f6c6026cff97966a740576285e07b
-   Author: Johannes Weiner <hannes@cmpxchg.org>
-   Date:   Mon Sep 26 09:57:04 2022 -0400
-
-       mm: memcontrol: drop dead CONFIG_MEMCG_SWAP config symbol
-
-       Since 2d1c498072de ("mm: memcontrol: make swap tracking an integral part
-       of memory control"), CONFIG_MEMCG_SWAP hasn't been a user-visible config
-       option anymore, it just means CONFIG_MEMCG && CONFIG_SWAP.
-
-       Update the sites accordingly and drop the symbol.
-
-       [ While touching the docs, remove two references to CONFIG_MEMCG_KMEM,
-         which hasn't been a user-visible symbol for over half a decade. ]
-
-       Link: https://lkml.kernel.org/r/20220926135704.400818-5-hannes@cmpxchg.org
-       Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
-       Acked-by: Shakeel Butt <shakeelb@google.com>
-       Cc: Hugh Dickins <hughd@google.com>
-       Cc: Michal Hocko <mhocko@suse.com>
-       Cc: Roman Gushchin <roman.gushchin@linux.dev>
-       Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
----
- contrib/check-config.sh | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-Index: import/contrib/check-config.sh
-===================================================================
---- import.orig/contrib/check-config.sh
-+++ import/contrib/check-config.sh
-@@ -253,9 +253,11 @@ echo 'Optional Features:'
- 	check_flags SECCOMP_FILTER
- }
- {
--	check_flags CGROUP_PIDS
-+	if [ "$kernelMajor" -lt 6 ] || [ "$kernelMajor" -eq 6 -a "$kernelMinor" -le 1 ]; then
-+		check_flags CGROUP_PIDS
- }
- {
-+	fi
- 	# Kernel v5.8+ removes MEMCG_SWAP_ENABLED and deprecates MEMCG_SWAP.
- 	if [ "$kernelMajor" -lt 5 ] || [ "$kernelMajor" -eq 5 -a "$kernelMinor" -lt 8 ]; then
- 		CODE=${EXITCODE}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-virtualization][PATCH 2/2] container-registry: default to insecure only without a secure registry
  2026-11-29 21:48 [meta-virtualization][PATCH 0/2] docker-moby, container-registry: fix check-config and registry defaults John Madieu
  2026-11-29 21:48 ` [meta-virtualization][PATCH 1/2] docker-moby: drop the check-config patch for MEMCG_SWAP John Madieu
@ 2026-11-29 21:48 ` John Madieu
  2026-11-30  5:04   ` Bruce Ashfield
  1 sibling, 1 reply; 6+ messages in thread
From: John Madieu @ 2026-11-29 21:48 UTC (permalink / raw)
  To: meta-virtualization; +Cc: bruce.ashfield, John Madieu

container-registry.conf sets CONTAINER_REGISTRY_INSECURE ?= "1" and
its header says to override CONTAINER_REGISTRY_SECURE = "1" for a TLS
registry. Doing just that leaves both variables at 1, and parsing
stops with "CONTAINER_REGISTRY_SECURE and CONTAINER_REGISTRY_INSECURE
cannot both be set to '1'", so CONTAINER_REGISTRY_INSECURE = "0" has
to be set as well.

Derive the default of CONTAINER_REGISTRY_INSECURE from
CONTAINER_REGISTRY_SECURE, so that the documented override is enough.
An explicit CONTAINER_REGISTRY_INSECURE still wins.

Signed-off-by: John Madieu <john.madieu@gmail.com>
---
 conf/distro/include/container-registry.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/conf/distro/include/container-registry.conf b/conf/distro/include/container-registry.conf
index 357e7913..1ab512f5 100644
--- a/conf/distro/include/container-registry.conf
+++ b/conf/distro/include/container-registry.conf
@@ -24,6 +24,6 @@
 
 CONTAINER_REGISTRY_URL ?= "localhost:5000"
 CONTAINER_REGISTRY_NAMESPACE ?= "yocto"
-CONTAINER_REGISTRY_INSECURE ?= "1"
+CONTAINER_REGISTRY_INSECURE ?= "${@'0' if d.getVar('CONTAINER_REGISTRY_SECURE') == '1' else '1'}"
 
 IMAGE_FEATURES:append = " container-registry"
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [meta-virtualization][PATCH 1/2] docker-moby: drop the check-config patch for MEMCG_SWAP
  2026-11-29 21:48 ` [meta-virtualization][PATCH 1/2] docker-moby: drop the check-config patch for MEMCG_SWAP John Madieu
@ 2026-11-30  5:04   ` Bruce Ashfield
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce Ashfield @ 2026-11-30  5:04 UTC (permalink / raw)
  To: John Madieu; +Cc: meta-virtualization

merged

Bruce

> check-config.sh of docker-v29 only checks MEMCG_SWAP on kernels older
> than 5.8, so the patch that skipped that check on 6.1+ kernels has
> nothing left to do.
>
> When the patch was refreshed for docker-v29.0.0-rc.1, its hunk moved
> onto the CGROUP_PIDS check, where it opens an if in one { } block and
> closes it with fi in the next. The installed check-config.sh stops
> with a syntax error after the optional features, before the network
> and storage driver checks.
>
> Drop the patch.
>
> Signed-off-by: John Madieu <john.madieu@gmail.com>
> ---
>  recipes-containers/docker/docker-moby_git.bb  |  1 -
>  ...g-make-CONFIG_MEMCG_SWAP-conditional.patch | 55 -------------------
>  2 files changed, 56 deletions(-)
>  delete mode 100644 recipes-containers/docker/files/0001-check-config-make-CONFIG_MEMCG_SWAP-conditional.patch
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [meta-virtualization][PATCH 2/2] container-registry: default to insecure only without a secure registry
  2026-11-29 21:48 ` [meta-virtualization][PATCH 2/2] container-registry: default to insecure only without a secure registry John Madieu
@ 2026-11-30  5:04   ` Bruce Ashfield
  2026-11-30 11:04     ` john madieu
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce Ashfield @ 2026-11-30  5:04 UTC (permalink / raw)
  To: John Madieu; +Cc: meta-virtualization

> container-registry.conf sets CONTAINER_REGISTRY_INSECURE ?= "1" and
> its header says to override CONTAINER_REGISTRY_SECURE = "1" for a TLS
> registry. Doing just that leaves both variables at 1, and parsing
> stops with "CONTAINER_REGISTRY_SECURE and CONTAINER_REGISTRY_INSECURE
> cannot both be set to '1'", so CONTAINER_REGISTRY_INSECURE = "0" has
> to be set as well.

Thanks for finding this, but I fixed it a different way. What was
wrong is the advice in the fragment header and in build-profiles.md:
container-registry.conf is the insecure registry, so turning secure on
on top of it really is turning on both, and the error is right.

> Derive the default of CONTAINER_REGISTRY_INSECURE from
> CONTAINER_REGISTRY_SECURE, so that the documented override is enough.
> An explicit CONTAINER_REGISTRY_INSECURE still wins.

I'd rather not key one default off the other. Instead there's now a
container-registry-secure.conf fragment, so a TLS registry is just:

  require conf/distro/include/container-registry-secure.conf

The insecure fragment and the docs point at it, and including both
fragments is still an error, with a message that says to pick one. It's
on master as "conf/distro: add a secure container registry
fragment" .. let me know if that works for your qemuarm64 setup.

Bruce

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [meta-virtualization][PATCH 2/2] container-registry: default to insecure only without a secure registry
  2026-11-30  5:04   ` Bruce Ashfield
@ 2026-11-30 11:04     ` john madieu
  0 siblings, 0 replies; 6+ messages in thread
From: john madieu @ 2026-11-30 11:04 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization

[-- Attachment #1: Type: text/plain, Size: 678 bytes --]

Hi Bruce,

Thanks for your feedback.


> The insecure fragment and the docs point at it, and including both
> fragments is still an error, with a message that says to pick one. It's
> on master as "conf/distro: add a secure container registry
> fragment" .. let me know if that works for your qemuarm64 setup.
>

The secure fragment works for my qemuarm64 setup. With 8f20dd54 on
top of OE-core master, a Docker host that only requires
container-registry-secure.conf builds, gets the registry CA in
/etc/docker/certs.d/<registry>/, and pulls over HTTPS from the
generated registry. Requiring both fragments stops at parse time with
the new message.


>
> Bruce
>

Regards,
John

[-- Attachment #2: Type: text/html, Size: 1216 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-30 11:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 21:48 [meta-virtualization][PATCH 0/2] docker-moby, container-registry: fix check-config and registry defaults John Madieu
2026-11-29 21:48 ` [meta-virtualization][PATCH 1/2] docker-moby: drop the check-config patch for MEMCG_SWAP John Madieu
2026-11-30  5:04   ` Bruce Ashfield
2026-11-29 21:48 ` [meta-virtualization][PATCH 2/2] container-registry: default to insecure only without a secure registry John Madieu
2026-11-30  5:04   ` Bruce Ashfield
2026-11-30 11:04     ` john madieu

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.