Documentation/dev-tools/container.rst
Source file repositories/reference/linux-study-clean/Documentation/dev-tools/container.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/dev-tools/container.rst- Extension
.rst- Size
- 8539 bytes
- Lines
- 228
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
.. SPDX-License-Identifier: GPL-2.0-only
.. Copyright (C) 2025 Guillaume Tucker
====================
Containerized Builds
====================
The ``container`` tool can be used to run any command in the kernel source tree
from within a container. Doing so facilitates reproducing builds across
various platforms, for example when a test bot has reported an issue which
requires a specific version of a compiler or an external test suite. While
this can already be done by users who are familiar with containers, having a
dedicated tool in the kernel tree lowers the barrier to entry by solving common
problems once and for all (e.g. user id management). It also makes it easier
to share an exact command line leading to a particular result. The main use
case is likely to be kernel builds but virtually anything can be run: KUnit,
checkpatch etc. provided a suitable image is available.
Options
=======
Command line syntax::
scripts/container -i IMAGE [OPTION]... CMD...
Available options:
``-e, --env-file ENV_FILE``
Path to an environment file to load in the container.
``-g, --gid GID``
Group id to use inside the container.
``-i, --image IMAGE``
Container image name (required).
``-r, --runtime RUNTIME``
Container runtime name. Supported runtimes: ``docker``, ``podman``.
If not specified, the first one found on the system will be used
i.e. Podman if present, otherwise Docker.
``-s, --shell``
Run the container in an interactive shell.
``-u, --uid UID``
User id to use inside the container.
If the ``-g`` option is not specified, the user id will also be used for
the group id.
``-v, --verbose``
Enable verbose output.
``-h, --help``
Show the help message and exit.
Usage
=====
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.