
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Docker images containing pre-installed Ubuntu mainline kernel headers from kernel.ubuntu.com/mainline.
Two image types are produced for each kernel series (e.g. 7.0):
| Image | Purpose | Platforms |
|---|---|---|
vicamo/mainline-kernel-headers:<KVER>-archive | Architecture-independent archive of all .deb files | linux/amd64 |
vicamo/mainline-kernel-headers:<KVER> | Headers image — installed kernel headers (Ubuntu-based) | linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le, linux/s390x |
A shared base image is also produced per Ubuntu series:
| Image | Purpose | Platforms |
|---|---|---|
vicamo/mainline-kernel-headers:<SERIES>-dkms | Ubuntu base with dkms pre-installed | linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le, linux/s390x |
Multiple kernel series may share the same dkms image (e.g. 6.17, 6.18, 6.19 all use questing-dkms).
List installed kernel header versions:
shdocker run --rm vicamo/mainline-kernel-headers:7.0
Use as a base image for out-of-tree module builds:
dockerfileFROM vicamo/mainline-kernel-headers:7.0 RUN apt-get update && apt-get install -y build-essential # Build your module against any installed kernel version
The build is split into two Dockerfiles. Dockerfile produces the headers
image (the primary artifact); Dockerfile.archive produces the intermediate
archive image.
Stores all kernel header .deb packages (for all architectures) from a
local debs/<KVER>/ directory into a minimal image. This image is
architecture-independent and supports incremental builds. The actual fetching
is performed by scripts/build-archive before invoking Docker.
sh# Typically invoked via scripts/build-archive, but can be run manually # after populating debs/<KVER>/: docker build -f Dockerfile.archive --build-arg KVER=7.0 \ --build-arg ARCHIVE_IMAGE=scratch \ -t vicamo/mainline-kernel-headers:7.0-archive .
Produces a multi-platform Ubuntu base image with dkms pre-installed. Used as
the cold-start base for headers images. Multiple kernel series that target the
same Ubuntu release share a single dkms image.
shdocker buildx build -f Dockerfile.dkms \ --platform linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x \ --build-arg SERIES=noble \ -t vicamo/mainline-kernel-headers:noble-dkms .
Takes an archive image and installs the appropriate .deb packages for the
target architecture using dpkg --force-depends. Supports multi-platform
builds via Docker buildx.
sh# Cold start (no previous headers image — uses dkms base) docker buildx build \ --platform linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x \ --build-arg KVER=7.0 \ --build-arg BASE_IMAGE=vicamo/mainline-kernel-headers:resolute-dkms \ --build-arg ARCHIVE_IMAGE=vicamo/mainline-kernel-headers:7.0-archive \ -t vicamo/mainline-kernel-headers:7.0 . # Incremental build (installs only new versions on top of existing headers image) docker buildx build \ --platform linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x \ --build-arg KVER=7.0 \ --build-arg ARCHIVE_IMAGE=vicamo/mainline-kernel-headers:7.0-archive \ -t vicamo/mainline-kernel-headers:7.0 .
Three helper scripts are provided under scripts/:
Build the archive image for a single kernel series.
sh./scripts/build-archive <KVER> [--push] [--image PREFIX]
| Flag | Default | Description |
|---|---|---|
--push | (off) | Push image to the registry; without it, image is loaded locally |
--image | vicamo/mainline-kernel-headers | Image name prefix |
Examples:
sh# Build locally ./scripts/build-archive 7.0 # Build and push to Docker Hub ./scripts/build-archive 7.0 --push
The script fetches all kernel header .deb packages from kernel.ubuntu.com
into debs/<KVER>/, then builds the archive Docker image. It automatically
detects whether a previous archive image exists and performs an incremental
build when possible. Already-downloaded versions are skipped on subsequent runs.
Build the headers image for a single kernel series. Requires the archive image to already exist.
sh./scripts/build-version <KVER> [--push] [--image PREFIX] [--platforms PLATFORMS]
| Flag | Default | Description |
|---|---|---|
--push | (off) | Push image to the registry; without it, image is loaded locally (native platform only) |
--image | vicamo/mainline-kernel-headers | Image name prefix |
--platforms | linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x | Target platforms for the headers image (only with --push) |
--force | (off) | Force rebuild even if archive is unchanged |
--clean | (off) | Build from scratch (Ubuntu base) instead of previous headers image |
Examples:
sh# Build locally for testing ./scripts/build-version 7.0 # Build and push to Docker Hub ./scripts/build-version 7.0 --push # Push to a custom registry with fewer platforms ./scripts/build-version 7.0 --push --image myrepo/kernel-headers --platforms linux/amd64,linux/arm64
The script builds the multi-platform headers image. It automatically detects
whether a previous headers image exists and performs an incremental build when
possible. The archive image must already exist (run build-archive first).
Build all active kernel versions (stable + longterm, not EOL) as reported by kernel.org.
sh./scripts/build-all [--push] [--image PREFIX] [--platforms PLATFORMS]
All flags are passed through to build-version for each kernel series.
A summary is printed at the end with any failures.
sh# Build and push all active versions ./scripts/build-all --push
| Arg | Required | Default | Description |
|---|---|---|---|
SERIES | No | noble | Ubuntu series codename (e.g. noble, questing, jammy) |
| Arg | Required | Default | Description |
|---|---|---|---|
KVER | Yes | — | Kernel series, e.g. 6.14, 7.0 |
ARCHIVE_IMAGE | No | mainline-kernel-headers:<KVER>-archive | Previous archive image for incremental builds; set to scratch for cold start |
| Arg | Required | Default | Description |
|---|---|---|---|
KVER | Yes | — | Kernel series, e.g. 6.14, 7.0 |
BASE_IMAGE | No | mainline-kernel-headers:<KVER> | Previous headers image; set to <SERIES>-dkms image for cold start |
ARCHIVE_IMAGE | No | mainline-kernel-headers:<KVER>-archive | Archive image containing the .deb files |
ARCHIVE_PLATFORM | No | linux/amd64 | Platform of the archive image (archive is arch-independent, pinned to amd64 by default) |
Check available platforms:
shdocker buildx imagetools inspect vicamo/mainline-kernel-headers:7.0
Images are available from kernel series 5.19 through 7.0.
The kernel header packages are distributed under the terms of the Linux kernel license (GPL-2.0). The Dockerfiles in this repository are provided as-is.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务