€•ЇŒsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ'/translations/zh_CN/dev-tools/container”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/zh_TW/dev-tools/container”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/it_IT/dev-tools/container”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ja_JP/dev-tools/container”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ko_KR/dev-tools/container”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/pt_BR/dev-tools/container”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/sp_SP/dev-tools/container”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ%SPDX-License-Identifier: GPL-2.0-only”h]”hŒ%SPDX-License-Identifier: GPL-2.0-only”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒA/var/lib/git/docbuild/linux/Documentation/dev-tools/container.rst”h´Kubh¶)�”}”(hŒ#Copyright (C) 2025 Guillaume Tucker”h]”hŒ#Copyright (C) 2025 Guillaume Tucker”…”�”}”hhÈsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1hµhhh²hh³hÇh´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒContainerized Builds”h]”hŒContainerized Builds”…”�”}”(hhÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhhØh²hh³hÇh´KubhŒ paragraph”“”)�”}”(hXì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.”h]”(hŒThe ”…”�”}”(hhíh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ ``container``”h]”hŒ container”…”�”}”(hh÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhíubhXÛ 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.”…”�”}”(hhíh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KhhØh²hubh×)�”}”(hhh]”(hÜ)�”}”(hŒOptions”h]”hŒOptions”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjh²hh³hÇh´Kubhì)�”}”(hŒCommand line syntax::”h]”hŒCommand line syntax:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Khjh²hubhŒ literal_block”“”)�”}”(hŒ-scripts/container -i IMAGE [OPTION]... CMD...”h]”hŒ-scripts/container -i IMAGE [OPTION]... CMD...”…”�”}”hj0sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´Khjh²hubhì)�”}”(hŒAvailable options:”h]”hŒAvailable options:”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Khjh²hubhì)�”}”(hŒ``-e, --env-file ENV_FILE``”h]”hö)�”}”(hjNh]”hŒ-e, --env-file ENV_FILE”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjLubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Khjh²hubhŒ block_quote”“”)�”}”(hŒ6Path to an environment file to load in the container. ”h]”hì)�”}”(hŒ5Path to an environment file to load in the container.”h]”hŒ5Path to an environment file to load in the container.”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Khjeubah}”(h]”h ]”h"]”h$]”h&]”uh1jch³hÇh´Khjh²hubhì)�”}”(hŒ``-g, --gid GID``”h]”hö)�”}”(hjh]”hŒ -g, --gid GID”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj}ubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K!hjh²hubjd)�”}”(hŒ&Group id to use inside the container. ”h]”hì)�”}”(hŒ%Group id to use inside the container.”h]”hŒ%Group id to use inside the container.”…”�”}”(hj˜h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K#hj”ubah}”(h]”h ]”h"]”h$]”h&]”uh1jch³hÇh´K#hjh²hubhì)�”}”(hŒ``-i, --image IMAGE``”h]”hö)�”}”(hj®h]”hŒ-i, --image IMAGE”…”�”}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj¬ubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K%hjh²hubjd)�”}”(hŒ!Container image name (required). ”h]”hì)�”}”(hŒ Container image name (required).”h]”hŒ Container image name (required).”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K'hjÃubah}”(h]”h ]”h"]”h$]”h&]”uh1jch³hÇh´K'hjh²hubhì)�”}”(hŒ``-r, --runtime RUNTIME``”h]”hö)�”}”(hjÝh]”hŒ-r, --runtime RUNTIME”…”�”}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjÛubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K)hjh²hubjd)�”}”(hŒ±Container runtime name. Supported runtimes: ``podman``, ``docker``. If not specified, the first one found on the system will be used i.e. Podman if present, otherwise Docker. ”h]”(hì)�”}”(hŒDContainer runtime name. Supported runtimes: ``podman``, ``docker``.”h]”(hŒ-Container runtime name. Supported runtimes: ”…”�”}”(hjöh²hh³Nh´Nubhö)�”}”(hŒ ``podman``”h]”hŒpodman”…”�”}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjöubhŒ, ”…”�”}”(hjöh²hh³Nh´Nubhö)�”}”(hŒ ``docker``”h]”hŒdocker”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjöubhŒ.”…”�”}”(hjöh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K+hjòubhì)�”}”(hŒjIf not specified, the first one found on the system will be used i.e. Podman if present, otherwise Docker.”h]”hŒjIf not specified, the first one found on the system will be used i.e. Podman if present, otherwise Docker.”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K-hjòubeh}”(h]”h ]”h"]”h$]”h&]”uh1jch³hÇh´K+hjh²hubhì)�”}”(hŒ``-s, --shell``”h]”hö)�”}”(hj>h]”hŒ -s, --shell”…”�”}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj<ubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K0hjh²hubjd)�”}”(hŒ+Run the container in an interactive shell. ”h]”hì)�”}”(hŒ*Run the container in an interactive shell.”h]”hŒ*Run the container in an interactive shell.”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K2hjSubah}”(h]”h ]”h"]”h$]”h&]”uh1jch³hÇh´K2hjh²hubhì)�”}”(hŒ``-u, --uid UID``”h]”hö)�”}”(hjmh]”hŒ -u, --uid UID”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjkubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K4hjh²hubjd)�”}”(hŒ}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. ”h]”(hì)�”}”(hŒ$User id to use inside the container.”h]”hŒ$User id to use inside the container.”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K6hj‚ubhì)�”}”(hŒVIf the ``-g`` option is not specified, the user id will also be used for the group id.”h]”(hŒIf the ”…”�”}”(hj”h²hh³Nh´Nubhö)�”}”(hŒ``-g``”h]”hŒ-g”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj”ubhŒI option is not specified, the user id will also be used for the group id.”…”�”}”(hj”h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K8hj‚ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jch³hÇh´K6hjh²hubhì)�”}”(hŒ``-v, --verbose``”h]”hö)�”}”(hj¼h]”hŒ -v, --verbose”…”�”}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjºubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K;hjh²hubjd)�”}”(hŒEnable verbose output. ”h]”hì)�”}”(hŒEnable verbose output.”h]”hŒEnable verbose output.”…”�”}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K=hjÑubah}”(h]”h ]”h"]”h$]”h&]”uh1jch³hÇh´K=hjh²hubhì)�”}”(hŒ``-h, --help``”h]”hö)�”}”(hjëh]”hŒ -h, --help”…”�”}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjéubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K?hjh²hubjd)�”}”(hŒ!Show the help message and exit. ”h]”hì)�”}”(hŒShow the help message and exit.”h]”hŒShow the help message and exit.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KAhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jch³hÇh´KAhjh²hubeh}”(h]”Œoptions”ah ]”h"]”Œoptions”ah$]”h&]”uh1hÖhhØh²hh³hÇh´Kubh×)�”}”(hhh]”(hÜ)�”}”(hŒUsage”h]”hŒUsage”…”�”}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj h²hh³hÇh´KEubhì)�”}”(hXIt's entirely up to the user to choose which image to use and the ``CMD`` arguments are passed directly as an arbitrary command line to run in the container. The tool will take care of mounting the source tree as the current working directory and adjust the user and group id as needed.”h]”(hŒDIt’s entirely up to the user to choose which image to use and the ”…”�”}”(hj1h²hh³Nh´Nubhö)�”}”(hŒ``CMD``”h]”hŒCMD”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj1ubhŒÖ arguments are passed directly as an arbitrary command line to run in the container. The tool will take care of mounting the source tree as the current working directory and adjust the user and group id as needed.”…”�”}”(hj1h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KGhj h²hubhì)�”}”(hX°The container image which would typically include a compiler toolchain is provided by the user and selected via the ``-i`` option. The container runtime can be selected with the ``-r`` option, which can be either ``podman`` or ``docker``. If none is specified, the first one found on the system will be used while giving priority to Podman. Support for other runtimes may be added later depending on their popularity among users.”h]”(hŒtThe container image which would typically include a compiler toolchain is provided by the user and selected via the ”…”�”}”(hjQh²hh³Nh´Nubhö)�”}”(hŒ``-i``”h]”hŒ-i”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjQubhŒ9 option. The container runtime can be selected with the ”…”�”}”(hjQh²hh³Nh´Nubhö)�”}”(hŒ``-r``”h]”hŒ-r”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjQubhŒ option, which can be either ”…”�”}”(hjQh²hh³Nh´Nubhö)�”}”(hŒ ``podman``”h]”hŒpodman”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjQubhŒ or ”…”�”}”(hjQh²hh³Nh´Nubhö)�”}”(hŒ ``docker``”h]”hŒdocker”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjQubhŒÂ. If none is specified, the first one found on the system will be used while giving priority to Podman. Support for other runtimes may be added later depending on their popularity among users.”…”�”}”(hjQh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KLhj h²hubhì)�”}”(hX`By default, commands are run non-interactively. The user can abort a running container with SIGINT (Ctrl-C). To run commands interactively with a TTY, the ``--shell`` or ``-s`` option can be used. Signals will then be received by the shell directly rather than the parent ``container`` process. To exit an interactive shell, use Ctrl-D or ``exit``.”h]”(hŒ�By default, commands are run non-interactively. The user can abort a running container with SIGINT (Ctrl-C). To run commands interactively with a TTY, the ”…”�”}”(hj§h²hh³Nh´Nubhö)�”}”(hŒ ``--shell``”h]”hŒ--shell”…”�”}”(hj¯h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj§ubhŒ or ”…”�”}”(hj§h²hh³Nh´Nubhö)�”}”(hŒ``-s``”h]”hŒ-s”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj§ubhŒa option can be used. Signals will then be received by the shell directly rather than the parent ”…”�”}”(hj§h²hh³Nh´Nubhö)�”}”(hŒ ``container``”h]”hŒ container”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj§ubhŒ7 process. To exit an interactive shell, use Ctrl-D or ”…”�”}”(hj§h²hh³Nh´Nubhö)�”}”(hŒ``exit``”h]”hŒexit”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj§ubhŒ.”…”�”}”(hj§h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KShj h²hubhŒnote”“”)�”}”(hŒQThe only host requirement aside from a container runtime is Python 3.10 or later.”h]”hì)�”}”(hŒQThe only host requirement aside from a container runtime is Python 3.10 or later.”h]”hŒQThe only host requirement aside from a container runtime is Python 3.10 or later.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K[hjÿubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhj h²hh³hÇh´Nubjþ)�”}”(hXOut-of-tree builds are not fully supported yet. The ``O=`` option can however already be used with a relative path inside the source tree to keep separate build outputs. A workaround to build outside the tree is to use ``mount --bind``, see the examples section further down.”h]”hì)�”}”(hXOut-of-tree builds are not fully supported yet. The ``O=`` option can however already be used with a relative path inside the source tree to keep separate build outputs. A workaround to build outside the tree is to use ``mount --bind``, see the examples section further down.”h]”(hŒ5Out-of-tree builds are not fully supported yet. The ”…”�”}”(hjh²hh³Nh´Nubhö)�”}”(hŒ``O=``”h]”hŒO=”…”�”}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjubhŒ¢ option can however already be used with a relative path inside the source tree to keep separate build outputs. A workaround to build outside the tree is to use ”…”�”}”(hjh²hh³Nh´Nubhö)�”}”(hŒ``mount --bind``”h]”hŒ mount --bind”…”�”}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjubhŒ(, see the examples section further down.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K`hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhj h²hh³hÇh´Nubeh}”(h]”Œusage”ah ]”h"]”Œusage”ah$]”h&]”uh1hÖhhØh²hh³hÇh´KEubh×)�”}”(hhh]”(hÜ)�”}”(hŒEnvironment Variables”h]”hŒEnvironment Variables”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj[h²hh³hÇh´Kgubhì)�”}”(hX[Environment variables are not propagated to the container so they have to be either defined in the image itself or via the ``-e`` option using an environment file. In some cases it makes more sense to have them defined in the Containerfile used to create the image. For example, a Clang-only compiler toolchain image may have ``LLVM=1`` defined.”h]”(hŒ{Environment variables are not propagated to the container so they have to be either defined in the image itself or via the ”…”�”}”(hjlh²hh³Nh´Nubhö)�”}”(hŒ``-e``”h]”hŒ-e”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjlubhŒÇ option using an environment file. In some cases it makes more sense to have them defined in the Containerfile used to create the image. For example, a Clang-only compiler toolchain image may have ”…”�”}”(hjlh²hh³Nh´Nubhö)�”}”(hŒ ``LLVM=1``”h]”hŒLLVM=1”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjlubhŒ defined.”…”�”}”(hjlh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kihj[h²hubhì)�”}”(hŒèThe local environment file is more useful for user-specific variables added during development. It is passed as-is to the container runtime so its format may vary. Typically, it will look like the output of ``env``. For example::”h]”(hŒÑThe local environment file is more useful for user-specific variables added during development. It is passed as-is to the container runtime so its format may vary. Typically, it will look like the output of ”…”�”}”(hjžh²hh³Nh´Nubhö)�”}”(hŒ``env``”h]”hŒenv”…”�”}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjžubhŒ. For example:”…”�”}”(hjžh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kohj[h²hubj/)�”}”(hŒ4INSTALL_MOD_STRIP=1 SOME_RANDOM_TEXT=One upon a time”h]”hŒ4INSTALL_MOD_STRIP=1 SOME_RANDOM_TEXT=One upon a time”…”�”}”hj¾sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´Kshj[h²hubhì)�”}”(hŒ¡Please also note that ``make`` options can still be passed on the command line, so while this can't be done since the first argument needs to be the executable::”h]”(hŒPlease also note that ”…”�”}”(hjÌh²hh³Nh´Nubhö)�”}”(hŒ``make``”h]”hŒmake”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjÌubhŒ„ options can still be passed on the command line, so while this can’t be done since the first argument needs to be the executable:”…”�”}”(hjÌh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kvhj[h²hubj/)�”}”(hŒKscripts/container -i docker.io/tuxmake/korg-clang LLVM=1 make # won't work”h]”hŒKscripts/container -i docker.io/tuxmake/korg-clang LLVM=1 make # won't work”…”�”}”hjìsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´Kzhj[h²hubhì)�”}”(hŒthis will work::”h]”hŒthis will work:”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K|hj[h²hubj/)�”}”(hŒ=scripts/container -i docker.io/tuxmake/korg-clang make LLVM=1”h]”hŒ=scripts/container -i docker.io/tuxmake/korg-clang make LLVM=1”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´K~hj[h²hubeh}”(h]”Œenvironment-variables”ah ]”h"]”Œenvironment variables”ah$]”h&]”uh1hÖhhØh²hh³hÇh´Kgubh×)�”}”(hhh]”(hÜ)�”}”(hŒUser IDs”h]”hŒUser IDs”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjh²hh³hÇh´K‚ubhì)�”}”(hXâThis is an area where the behaviour will vary slightly depending on the container runtime. The goal is to run commands as the user invoking the tool. With Podman, a namespace is created to map the current user id to a different one in the container (1000 by default). With Docker, while this is also possible with recent versions it requires a special feature to be enabled in the daemon so it's not used here for simplicity. Instead, the container is run with the current user id directly. In both cases, this will provide the same file permissions for the kernel source tree mounted as a volume. The only difference is that when using Docker without a namespace, the user id may not be the same as the default one set in the image.”h]”hXäThis is an area where the behaviour will vary slightly depending on the container runtime. The goal is to run commands as the user invoking the tool. With Podman, a namespace is created to map the current user id to a different one in the container (1000 by default). With Docker, while this is also possible with recent versions it requires a special feature to be enabled in the daemon so it’s not used here for simplicity. Instead, the container is run with the current user id directly. In both cases, this will provide the same file permissions for the kernel source tree mounted as a volume. The only difference is that when using Docker without a namespace, the user id may not be the same as the default one set in the image.”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K„hjh²hubhì)�”}”(hXÌSay, we're using an image which sets up a default user with id 1000 and the current user calling the ``container`` tool has id 1234. The kernel source tree was checked out by this same user so the files belong to user 1234. With Podman, the container will be running as user id 1000 with a mapping to id 1234 so that the files from the mounted volume appear to belong to id 1000 inside the container. With Docker and no namespace, the container will be running with user id 1234 which can access the files in the volume but not in the user 1000 home directory. This shouldn't be an issue when running commands only in the kernel tree but it is worth highlighting here as it might matter for special corner cases.”h]”(hŒgSay, we’re using an image which sets up a default user with id 1000 and the current user calling the ”…”�”}”(hj=h²hh³Nh´Nubhö)�”}”(hŒ ``container``”h]”hŒ container”…”�”}”(hjEh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj=ubhX\ tool has id 1234. The kernel source tree was checked out by this same user so the files belong to user 1234. With Podman, the container will be running as user id 1000 with a mapping to id 1234 so that the files from the mounted volume appear to belong to id 1000 inside the container. With Docker and no namespace, the container will be running with user id 1234 which can access the files in the volume but not in the user 1000 home directory. This shouldn’t be an issue when running commands only in the kernel tree but it is worth highlighting here as it might matter for special corner cases.”…”�”}”(hj=h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K�hjh²hubjþ)�”}”(hX0Podman's `Docker compatibility `__ mode to run ``docker`` commands on top of a Podman backend is more complex and not fully supported yet. As such, Podman will take priority if both runtimes are available on the system.”h]”hì)�”}”(hX0Podman's `Docker compatibility `__ mode to run ``docker`` commands on top of a Podman backend is more complex and not fully supported yet. As such, Podman will take priority if both runtimes are available on the system.”h]”(hŒ Podman’s ”…”�”}”(hjah²hh³Nh´NubhŒ reference”“”)�”}”(hŒm`Docker compatibility `__”h]”hŒDocker compatibility”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”ŒDocker compatibility”Œrefuri”ŒRhttps://podman-desktop.io/docs/migrating-from-docker/managing-docker-compatibility”uh1jihjaubhŒ mode to run ”…”�”}”(hjah²hh³Nh´Nubhö)�”}”(hŒ ``docker``”h]”hŒdocker”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjaubhŒ£ commands on top of a Podman backend is more complex and not fully supported yet. As such, Podman will take priority if both runtimes are available on the system.”…”�”}”(hjah²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kœhj]ubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjh²hh³hÇh´Nubeh}”(h]”Œuser-ids”ah ]”h"]”Œuser ids”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K‚ubh×)�”}”(hhh]”(hÜ)�”}”(hŒExamples”h]”hŒExamples”…”�”}”(hjªh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhj§h²hh³hÇh´K¤ubhì)�”}”(hŒÐThe TuxMake project provides a variety of prebuilt container images available on `Docker Hub `__. Here's the shortest example to build a kernel using a TuxMake Clang image::”h]”(hŒQThe TuxMake project provides a variety of prebuilt container images available on ”…”�”}”(hj¸h²hh³Nh´Nubjj)�”}”(hŒ1`Docker Hub `__”h]”hŒ Docker Hub”…”�”}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ Docker Hub”j{Œ https://hub.docker.com/u/tuxmake”uh1jihj¸ubhŒO. Here’s the shortest example to build a kernel using a TuxMake Clang image:”…”�”}”(hj¸h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K¦hj§h²hubj/)�”}”(hŒ–scripts/container -i docker.io/tuxmake/korg-clang -- make LLVM=1 defconfig scripts/container -i docker.io/tuxmake/korg-clang -- make LLVM=1 -j$(nproc)”h]”hŒ–scripts/container -i docker.io/tuxmake/korg-clang -- make LLVM=1 defconfig scripts/container -i docker.io/tuxmake/korg-clang -- make LLVM=1 -j$(nproc)”…”�”}”hjÛsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´Kªhj§h²hubjþ)�”}”(hX6When running a command with options within the container, it should be separated with a double dash ``--`` to not confuse them with the ``container`` tool options. Plain commands with no options don't strictly require the double dashes e.g.:: scripts/container -i docker.io/tuxmake/korg-clang make mrproper”h]”(hì)�”}”(hŒóWhen running a command with options within the container, it should be separated with a double dash ``--`` to not confuse them with the ``container`` tool options. Plain commands with no options don't strictly require the double dashes e.g.::”h]”(hŒdWhen running a command with options within the container, it should be separated with a double dash ”…”�”}”(hjíh²hh³Nh´Nubhö)�”}”(hŒ``--``”h]”hŒ--”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjíubhŒ to not confuse them with the ”…”�”}”(hjíh²hh³Nh´Nubhö)�”}”(hŒ ``container``”h]”hŒ container”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjíubhŒ_ tool options. Plain commands with no options don’t strictly require the double dashes e.g.:”…”�”}”(hjíh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K¯hjéubj/)�”}”(hŒ?scripts/container -i docker.io/tuxmake/korg-clang make mrproper”h]”hŒ?scripts/container -i docker.io/tuxmake/korg-clang make mrproper”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´K´hjéubeh}”(h]”h ]”h"]”h$]”h&]”uh1jýhj§h²hh³hÇh´Nubhì)�”}”(hŒOTo run ``checkpatch.pl`` in a ``patches`` directory with a generic Perl image::”h]”(hŒTo run ”…”�”}”(hj3h²hh³Nh´Nubhö)�”}”(hŒ``checkpatch.pl``”h]”hŒ checkpatch.pl”…”�”}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj3ubhŒ in a ”…”�”}”(hj3h²hh³Nh´Nubhö)�”}”(hŒ ``patches``”h]”hŒpatches”…”�”}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj3ubhŒ% directory with a generic Perl image:”…”�”}”(hj3h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´K¶hj§h²hubj/)�”}”(hŒEscripts/container -i perl:slim-trixie scripts/checkpatch.pl patches/*”h]”hŒEscripts/container -i perl:slim-trixie scripts/checkpatch.pl patches/*”…”�”}”hjesbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´K¸hj§h²hubhì)�”}”(hX¬As an alternative to the TuxMake images, the examples below refer to ``kernel.org`` images which are based on the `kernel.org compiler toolchains `__. These aren't (yet) officially available in any public registry but users can build their own locally instead using this `experimental repository `__ by running ``make PREFIX=kernel.org/``.”h]”(hŒEAs an alternative to the TuxMake images, the examples below refer to ”…”�”}”(hjsh²hh³Nh´Nubhö)�”}”(hŒ``kernel.org``”h]”hŒ kernel.org”…”�”}”(hj{h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjsubhŒ images which are based on the ”…”�”}”(hjsh²hh³Nh´Nubjj)�”}”(hŒO`kernel.org compiler toolchains `__”h]”hŒkernel.org compiler toolchains”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œkernel.org compiler toolchains”j{Œ*https://mirrors.edge.kernel.org/pub/tools/”uh1jihjsubhŒ}. These aren’t (yet) officially available in any public registry but users can build their own locally instead using this ”…”�”}”(hjsh²hh³Nh´Nubjj)�”}”(hŒH`experimental repository `__”h]”hŒexperimental repository”…”�”}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œexperimental repository”j{Œ*https://gitlab.com/gtucker/korg-containers”uh1jihjsubhŒ by running ”…”�”}”(hjsh²hh³Nh´Nubhö)�”}”(hŒ``make PREFIX=kernel.org/``”h]”hŒmake PREFIX=kernel.org/”…”�”}”(hj·h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjsubhŒ.”…”�”}”(hjsh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kºhj§h²hubhì)�”}”(hŒ'To build just ``bzImage`` using Clang::”h]”(hŒTo build just ”…”�”}”(hjÏh²hh³Nh´Nubhö)�”}”(hŒ ``bzImage``”h]”hŒbzImage”…”�”}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjÏubhŒ using Clang:”…”�”}”(hjÏh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÂhj§h²hubj/)�”}”(hŒ@scripts/container -i kernel.org/clang -- make bzImage -j$(nproc)”h]”hŒ@scripts/container -i kernel.org/clang -- make bzImage -j$(nproc)”…”�”}”hjïsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´KÄhj§h²hubhì)�”}”(hŒ.Same with GCC 15 as a particular version tag::”h]”hŒ-Same with GCC 15 as a particular version tag:”…”�”}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÆhj§h²hubj/)�”}”(hŒAscripts/container -i kernel.org/gcc:15 -- make bzImage -j$(nproc)”h]”hŒAscripts/container -i kernel.org/gcc:15 -- make bzImage -j$(nproc)”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´KÈhj§h²hubhì)�”}”(hŒxFor an out-of-tree build, a trick is to bind-mount the destination directory to a relative path inside the source tree::”h]”hŒwFor an out-of-tree build, a trick is to bind-mount the destination directory to a relative path inside the source tree:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÊhj§h²hubj/)�”}”(hXmkdir -p $HOME/tmp/my-kernel-build mkdir -p build sudo mount --bind $HOME/tmp/my-kernel-build build scripts/container -i kernel.org/gcc -- make mrproper scripts/container -i kernel.org/gcc -- make O=build defconfig scripts/container -i kernel.org/gcc -- make O=build -j$(nproc)”h]”hXmkdir -p $HOME/tmp/my-kernel-build mkdir -p build sudo mount --bind $HOME/tmp/my-kernel-build build scripts/container -i kernel.org/gcc -- make mrproper scripts/container -i kernel.org/gcc -- make O=build defconfig scripts/container -i kernel.org/gcc -- make O=build -j$(nproc)”…”�”}”hj'sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´KÍhj§h²hubhì)�”}”(hŒ>To run KUnit in an interactive shell and get the full output::”h]”hŒ=To run KUnit in an interactive shell and get the full output:”…”�”}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÔhj§h²hubj/)�”}”(hŒ scripts/container -s -i kernel.org/gcc:kunit -- \ tools/testing/kunit/kunit.py \ run \ --arch=x86_64 \ --cross_compile=x86_64-linux-”h]”hŒ scripts/container -s -i kernel.org/gcc:kunit -- \ tools/testing/kunit/kunit.py \ run \ --arch=x86_64 \ --cross_compile=x86_64-linux-”…”�”}”hjCsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´KÖhj§h²hubhì)�”}”(hŒ$To just start an interactive shell::”h]”hŒ#To just start an interactive shell:”…”�”}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´KÜhj§h²hubj/)�”}”(hŒ)scripts/container -si kernel.org/gcc bash”h]”hŒ)scripts/container -si kernel.org/gcc bash”…”�”}”hj_sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´KÞhj§h²hubhì)�”}”(hŒ“To build the HTML documentation, which requires the ``kdocs`` image built with ``make PREFIX=kernel.org/ extra`` as it's not a compiler toolchain::”h]”(hŒ4To build the HTML documentation, which requires the ”…”�”}”(hjmh²hh³Nh´Nubhö)�”}”(hŒ ``kdocs``”h]”hŒkdocs”…”�”}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjmubhŒ image built with ”…”�”}”(hjmh²hh³Nh´Nubhö)�”}”(hŒ!``make PREFIX=kernel.org/ extra``”h]”hŒmake PREFIX=kernel.org/ extra”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhjmubhŒ$ as it’s not a compiler toolchain:”…”�”}”(hjmh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hëh³hÇh´Kàhj§h²hubj/)�”}”(hŒ3scripts/container -i kernel.org/kdocs make htmldocs”h]”hŒ3scripts/container -i kernel.org/kdocs make htmldocs”…”�”}”hjŸsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j.h³hÇh´Kãhj§h²hubeh}”(h]”Œexamples”ah ]”h"]”Œexamples”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K¤ubeh}”(h]”Œcontainerized-builds”ah ]”h"]”Œcontainerized builds”ah$]”h&]”uh1hÖhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hÛNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jàŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jºj·jjjXjUjjj¤j¡j²j¯uŒ nametypes”}”(jº‰j‰jX‰j‰j¤‰j²‰uh}”(j·hØjjjUj jj[j¡jj¯j§uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.