mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guillaume Tucker <gtucker@gtucker.io>
To: Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nsc@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	Miguel Ojeda <ojeda@kernel.org>
Cc: "Onur Özkan" <work@onurozkan.dev>,
	linux-doc@vger.kernel.org, workflows@vger.kernel.org,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Documentation: dev-tools: cover registry option in container.rst
Date: Mon, 12 Oct 2026 23:48:57 +0200	[thread overview]
Message-ID: <d3237240-0de8-46d4-b58b-5a3a12fe4840@gtucker.io> (raw)
In-Reply-To: <d7d6735e4b287ae0cb6f873ee8763820cb6e1d7e.1791751900.git.gtucker@gtucker.io>

On 11/10/2026 10:54 pm, Guillaume Tucker wrote:
> Add the corresponding documentation entry for the new --registry
> command line option and TOML configuration file.  Update the examples
> accordingly to show how this can be used to override a registry name
> already defined within a default image name.

Sashiko wrote:

 > Does the patch contain these examples?
 >
 > The commit message mentions showing how to override a registry name
 > already defined within a default image name, but the examples added
 > in the patch only show overriding the registry setting in the
 > configuration file, not an embedded registry within an image
 > string.

By 'default' I meant an image name that would be used without
specifying it on the command line with the -i option.  That's not the
same as the [DEFAULT] section in the TOML file.  But it's true it
could be clarified by mentioning an image name from a profile section
instead, so I'll reword this in the v2.

> Signed-off-by: Guillaume Tucker <gtucker@gtucker.io>
> ---
>   Documentation/dev-tools/container.rst | 33 +++++++++++++++++++++++----
>   1 file changed, 29 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/dev-tools/container.rst b/Documentation/dev-tools/container.rst
> index 5dde95f6b222..3f2ba1fcf3bf 100644
> --- a/Documentation/dev-tools/container.rst
> +++ b/Documentation/dev-tools/container.rst
> @@ -48,6 +48,13 @@ Available options:
>       Profile section to use in the config file.  This will override any values
>       defined in the ``DEFAULT`` section.
>   
> +``-R, --registry REGISTRY``
> +
> +    Container registry name.
> +
> +    Any registry already included in the image name will be replaced or removed
> +    when using this option with no value.
> +
>   ``-r, --runtime RUNTIME``
>   
>       Container runtime name.  Supported runtimes: ``podman``, ``docker``.
> @@ -274,6 +281,15 @@ Supported options in each section are:
>       Name of the container image to use, equivalent to the ``-i`` command line
>       option.
>   
> +``registry``
> +
> +    Name of the container image registry to use, equivalent to the ``-R``
> +    command line option.  This will be used as a prefix before the image name
> +    with a ``/`` separator.
> +
> +    For example, a ``docker.io`` registry and a ``myuser/myimage`` image will
> +    result in ``docker.io/myuser/myimage`` as the full image path.
> +
>   ``runtime``
>   
>       Name of the container runtime, equivalent to the ``-r`` command line option.
> @@ -288,6 +304,7 @@ Here's a sample configuration with an extra ``clang`` profile::
>   
>     [DEFAULT]
>     runtime = "podman"
> +  registry = "docker.io"
>     image = "tuxmake/korg-gcc"
>   
>     [clang]
> @@ -306,10 +323,18 @@ Using the configuration file, it can now be simplified into this::
>   
>     scripts/container -p clang -- make defconfig
>   
> -Then to override the default user, the ``-u`` option can still be used::
> +Then to override the default runtime, the ``-r`` option can still be used::
> +
> +  scripts/container -p clang -r docker -- make defconfig
> +
> +Likewise, to override the registry name::
> +
> +  scripts/container -p clang -R my.registry.com -- make defconfig
> +
> +Or to not use any registry at all but only a local image::
>   
> -  scripts/container -p clang -u0 -- make defconfig
> +  scripts/container -p clang -R -- make defconfig
>   
> -This also illustrates how values take precedence over each other: the runtime
> +This also illustrates how values take precedence over each other: the registry
>   is loaded from the ``DEFAULT`` section, the image from the ``clang`` section
> -and the user ID from the command line ``-u`` option.
> +and the runtime from the command line ``-r`` option.

Sashiko wrote:

 > Does this explanation still match the example directly above it?
 >
 > The text explains that the registry is loaded from the DEFAULT
 > section and the runtime from the command line -r option. However,
 > the immediately preceding example is "scripts/container -p clang -R
 > -- make defconfig", where the registry is explicitly cleared and
 > there is no -r option used.

I see the issue, registry and runtime were swapped in the sentence.
This would be correct:

     This also illustrates how values take precedence over each other:
     the runtime is loaded from the ``DEFAULT`` section, the image
     from the ``clang`` section and the registry removed via the
     command line ``-R`` option.

I'll fix this in the v2 as well.


There were a couple of other comments already addressed in the first
patch about using hostnames rather than domain names, so nothing
further to add here about them.

And if anyone is wondering why it's useful to be able to override the
registry, a typical use case is when making modified images locally
before pushing them to a registry or when pulling images from a
development registry instead.  Say, in the TOML file a user can set
some standard images to be pulled from a public registry.  Then when
building a variant of an image, the user can just use the -R option
to pick it up instead of editing the file or duplicating profile
entries.  Validating the image names seems useful and it's a small
extra to be able to override the registry part once it's all parsed
into objects.  So it seems worth the extra few lines of code.

Guillaume

  reply	other threads:[~2026-10-12 21:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 20:54 [PATCH 1/2] scripts: add --registry option to container tool Guillaume Tucker
2026-10-11 20:54 ` [PATCH 2/2] Documentation: dev-tools: cover registry option in container.rst Guillaume Tucker
2026-10-12 21:48   ` Guillaume Tucker [this message]
2026-10-11 21:13 ` [PATCH 1/2] scripts: add --registry option to container tool Guillaume Tucker
2026-10-12 21:31 ` Guillaume Tucker
2026-11-05  4:29 ` Nathan Chancellor
2026-11-14 13:15   ` Guillaume Tucker

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=d3237240-0de8-46d4-b58b-5a3a12fe4840@gtucker.io \
    --to=gtucker@gtucker.io \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=work@onurozkan.dev \
    --cc=workflows@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®