All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Ashfield <bruce.ashfield@gmail.com>
To: ticotimo@gmail.com
Cc: meta-virtualization@lists.yoctoproject.org
Subject: Re: [meta-virtualization][PATCH 3/7] recipes-containers/images: add app-container-mosquitto
Date: Fri, 12 Jun 2026 11:06:31 -0700 (PDT)	[thread overview]
Message-ID: <6a2c4aa7.5059f1c4.36e2b7.af06@mx.google.com> (raw)
In-Reply-To: <8e68815affff4412c88b8a1139d6f916074bb3d1.1780104071.git.tim.orling@konsulko.com>

Hi Tim,

A few comments — most are series-level patterns that show up here for
the first time. I won't repeat them later to not waste our time

On Fri, May 29, 2026 at 18:31 -0700, Tim Orling wrote:
> Add OCI container image recipe for the Eclipse Mosquitto MQTT broker.
> The image uses multi-layer mode with separate base and mosquitto layers,
> exposes standard MQTT (1883) and WebSocket (9001) ports, and launches
> mosquitto with its default config file as the entrypoint.
>
> Inherit container-nonroot-user to run as 'nonroot' with UID 65532.

> +OCI_LAYERS = "\
> +    base:packages:base-files+base-passwd+netbase \
> +    mosquitto:packages:mosquitto \
> +"
[...]
> +IMAGE_INSTALL = " \
> +    base-files \
> +    base-passwd \
> +    netbase \
> +    mosquitto \
> +"

Same point as 2/7 — image-oci.bbclass now folds packages: layers into
IMAGE_INSTALL automatically (I pushed to master-next). When you respin,
this block can go.

> +# Workaround /var/volatile for now
> +ROOTFS_POSTPROCESS_COMMAND += "rootfs_fixup_var_volatile ; "
> +rootfs_fixup_var_volatile () {
> +    install -m 1777 -d ${IMAGE_ROOTFS}/${localstatedir}/volatile/tmp
> +    install -m 755 -d ${IMAGE_ROOTFS}/${localstatedir}/volatile/log
> +}

This same function appears in 3/7 (mosquitto), 4/7 (valkey), 5/7
(nginx), and 7/7 (curl) — four near-identical copies. Worth factoring
into a small helper bbclass (e.g. container-volatile-fixup.bbclass) that
each recipe can inherit, or rolling it into container-nonroot-user.bbclass
since every recipe that uses the fixup also inherits the nonroot class.
Not blocking — but it's a smell that's easy to silence in v2.

> +OCI_IMAGE_ENTRYPOINT = "${sbindir}/mosquitto"
> +OCI_IMAGE_ENTRYPOINT_ARGS = "-c '${sysconfdir}/mosquitto/mosquitto.conf'"

Two questions about running mosquitto as our nonroot (uid 65532):

1. The mosquitto package usually creates a 'mosquitto' system user
   (low uid, varies by build) and ships a default config that
   references paths under /var/lib/mosquitto/ and /var/log/mosquitto/
   owned by that user. As nonroot we won't be the package's expected
   user. Does mosquitto -c on the stock config actually start cleanly
   for you, or did you need to tweak the conf?

   I assume it runs fie, since you've been testing it for a while

2. If persistence is enabled in the stock mosquitto.conf (persistence
   true; persistence_location /var/lib/mosquitto/), we need a
   writable /var/lib/mosquitto for our nonroot user — same flavour of
   gap the rootfs_fixup_var_volatile workaround addresses, just for
   a different path. If you've already validated that persistence is
   off in the stock conf (or that mosquitto degrades gracefully when
   the persistence dir isn't writable), a one-line comment in the
   recipe explaining the trade-off would save the next person from
   re-deriving it.

Bruce

> +OCI_IMAGE_PORTS = "1883/tcp 9001/tcp"
> +OCI_IMAGE_TAG = "latest"


  parent reply	other threads:[~2026-06-12 18:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-30  1:31 [meta-virtualization][PATCH 0/7] Container improvements Tim Orling
2026-05-30  1:31 ` [meta-virtualization][PATCH 1/7] classes: add container-nonroot-user.bbclass Tim Orling
2026-05-30  1:31 ` [meta-virtualization][PATCH 2/7] recipes-containers/images: add app-container-python Tim Orling
2026-06-02 10:01   ` Paul Barker
2026-06-02 12:02     ` Bruce Ashfield
2026-05-30  1:31 ` [meta-virtualization][PATCH 3/7] recipes-containers/images: add app-container-mosquitto Tim Orling
2026-05-30  1:31 ` [meta-virtualization][PATCH 4/7] recipes-containers/images: add app-container-valkey Tim Orling
2026-05-30  1:31 ` [meta-virtualization][PATCH 5/7] recipes-containers/images: add app-container-nginx Tim Orling
2026-05-30  1:31 ` [meta-virtualization][PATCH 6/7] vcontainer-bbmask.inc: allow meta-webserver/recipes-httpd Tim Orling
2026-05-30  1:31 ` [meta-virtualization][PATCH 7/7] app-container-curl: use multilayer mode; container-nonroot-user Tim Orling
2026-06-05  3:31 ` [meta-virtualization][PATCH 0/7] Container improvements Bruce Ashfield
2026-06-12 16:54 ` [meta-virtualization][PATCH 1/7] classes: add container-nonroot-user.bbclass Bruce Ashfield
2026-06-12 17:57 ` [meta-virtualization][PATCH 2/7] recipes-containers/images: add app-container-python Bruce Ashfield
2026-06-12 18:06 ` Bruce Ashfield [this message]
2026-06-12 18:11 ` [meta-virtualization][PATCH 4/7] recipes-containers/images: add app-container-valkey Bruce Ashfield
2026-06-12 18:15 ` [meta-virtualization][PATCH 5/7] recipes-containers/images: add app-container-nginx Bruce Ashfield
2026-06-12 18:19 ` [meta-virtualization][PATCH 6/7] vcontainer-bbmask.inc: allow meta-webserver/recipes-httpd Bruce Ashfield
2026-06-12 18:23 ` [meta-virtualization][PATCH 7/7] app-container-curl: use multilayer mode; container-nonroot-user 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=6a2c4aa7.5059f1c4.36e2b7.af06@mx.google.com \
    --to=bruce.ashfield@gmail.com \
    --cc=meta-virtualization@lists.yoctoproject.org \
    --cc=ticotimo@gmail.com \
    /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.