All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Orling <ticotimo@gmail.com>
To: meta-virtualization@lists.yoctoproject.org
Cc: Tim Orling <tim.orling@konsulko.com>
Subject: [meta-virtualization][PATCH 3/3] app-container-nginx: create /run/nginx and /var/log/nginx in rootfs
Date: Sun, 22 Nov 2026 10:29:10 -0800	[thread overview]
Message-ID: <20261122182910.35849-4-tim.orling@konsulko.com> (raw)
In-Reply-To: <20261122182910.35849-1-tim.orling@konsulko.com>

nginx removes /run and ${localstatedir}/log from its package and creates
them at boot via tmpfiles.d or populate-volatile, which never runs in a
container. The nginx-dirs layer and NONROOT_OWNED_DIRS therefore find
nothing to copy or chown:

  OCI: Directory not found in IMAGE_ROOTFS: /run/nginx
  OCI: Directory not found in IMAGE_ROOTFS: /var/log/nginx

Create both directories in a ROOTFS_POSTPROCESS_COMMAND, appended after
rootfs_fixup_var_volatile so the /var/log -> volatile/log target exists.

Tested with the containers-library autobuilder target (aarch64 and
x86-64).

AI-Generated: Uses Claude Code (Claude Opus 5.5)
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 recipes-containers/images/app-container-nginx.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/recipes-containers/images/app-container-nginx.bb b/recipes-containers/images/app-container-nginx.bb
index f57c7887..c4e84bd3 100644
--- a/recipes-containers/images/app-container-nginx.bb
+++ b/recipes-containers/images/app-container-nginx.bb
@@ -47,6 +47,17 @@ inherit image-oci
 inherit container-nonroot-user
 inherit container-volatile-fixup
 
+# AI-generated (Claude Code, Claude Opus 5.5).
+# nginx deletes /run and /var/log from its package and relies on
+# tmpfiles.d/populate-volatile at boot to create them, which never runs in
+# a container. Create them at rootfs time so the nginx-dirs layer and
+# NONROOT_OWNED_DIRS find them. :append keeps this after
+# rootfs_fixup_var_volatile, which provides the /var/log symlink target.
+ROOTFS_POSTPROCESS_COMMAND:append = " nginx_container_dirs"
+nginx_container_dirs () {
+    install -d -m 0755 ${IMAGE_ROOTFS}/run/nginx ${IMAGE_ROOTFS}${localstatedir}/log/nginx
+}
+
 IMAGE_FEATURES = ""
 IMAGE_LINGUAS = ""
 NO_RECOMMENDATIONS = "1"
-- 
2.56.1


      parent reply	other threads:[~2026-11-22 18:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 18:29 [meta-virtualization][PATCH 0/3] OCI multi-layer fixes for dnf5 and nginx Tim Orling
2026-11-22 18:29 ` [meta-virtualization][PATCH 1/3] image-oci: track multi-layer rootfs directories with pseudo Tim Orling
2026-11-22 23:29   ` Bruce Ashfield
2026-11-22 18:29 ` [meta-virtualization][PATCH 2/3] container-volatile-fixup: run after empty_var_volatile Tim Orling
2026-11-22 18:29 ` Tim Orling [this message]

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=20261122182910.35849-4-tim.orling@konsulko.com \
    --to=ticotimo@gmail.com \
    --cc=meta-virtualization@lists.yoctoproject.org \
    --cc=tim.orling@konsulko.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.