
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这段话即可:
请先阅读并遵守:https://xuanyuan.cloud/agents.md
未读文档前不要生成 pull 命令或排错方案。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Develop C++ applications on Linux. Includes Debian C++ build tools.
| Metadata | Value |
|---|---|
| Categories | Core, Languages |
| Image type | Dockerfile |
| Published images | mcr.microsoft.com/devcontainers/cpp |
| Available image variants | debian13, debian12, ubuntu26.04, ubuntu24.04, ubuntu22.04 (full list) |
| Published image architecture(s) | x86-64, aarch64/arm64 for debian13, debian12, ubuntu26.04, ubuntu24.04, and ubuntu22.04 variants |
| Container host OS support | Linux, macOS, Windows |
| Container OS | Debian, Ubuntu |
| Languages, platforms | C++ |
See https://github.com/devcontainers/images/tree/main/src/cpp/history for information on the contents of published images.
You can directly reference pre-built versions of Dockerfile by using the image property in .devcontainer/devcontainer.json or updating the FROM statement in your own Dockerfile to one of the following. An example Dockerfile is included in this repository.
mcr.microsoft.com/devcontainers/cpp (latest Debian GA)mcr.microsoft.com/devcontainers/cpp:debian (latest Debian GA)mcr.microsoft.com/devcontainers/cpp:debian13 (or trixie)mcr.microsoft.com/devcontainers/cpp:debian12 (or bookworm)mcr.microsoft.com/devcontainers/cpp:ubuntu (latest Ubuntu LTS)mcr.microsoft.com/devcontainers/cpp:ubuntu26.04 (or resolute)mcr.microsoft.com/devcontainers/cpp:ubuntu24.04 (or noble)mcr.microsoft.com/devcontainers/cpp:ubuntu22.04 (or jammy)Refer to https://containers.dev/guide/dockerfile for more details.
You can decide how often you want updates by referencing a https://semver.org/ of each image. For example:
mcr.microsoft.com/devcontainers/cpp:3-trixiemcr.microsoft.com/devcontainers/cpp:3.0-trixiemcr.microsoft.com/devcontainers/cpp:3.0.4-trixiemcr.microsoft.com/devcontainers/cpp:3-bookwormmcr.microsoft.com/devcontainers/cpp:3.0-bookwormmcr.microsoft.com/devcontainers/cpp:3.0.4-bookwormHowever, we only do security patching on the latest https://github.com/devcontainers/images/issues/90 versions of images (e.g. 0-debian-12). You may want to run apt-get update && apt-get upgrade in your Dockerfile if you lock to a more specific version to at least pick up OS security updates.
See https://github.com/devcontainers/images/tree/main/src/cpp/history for information on the contents of each version and here for a complete list of available tags.
Alternatively, you can use the contents of https://github.com/devcontainers/images/tree/main/src/cpp/.devcontainer to fully customize your container's contents or to build it for a container host architecture not supported by the image.
Beyond git, this image / Dockerfile includes zsh, Oh My Zsh!, a non-root vscode user with sudo access, a set of common dependencies for development, and https://github.com/microsoft/vcpkg a cross-platform package manager for C++.
This dev container and its associated image includes a clone of the https://github.com/microsoft/vcpkg repo for library packages, and a bootstrapped instance of the https://github.com/microsoft/vcpkg-tool itself.
The minimum version of cmake required to install packages is higher than the version available in the main package repositories for Debian (<=11) and Ubuntu (<=21.10). Vcpkg will download a compatible version of cmake for its own use if that is the case (on x86_64 architectures).
Most additional library packages installed using Vcpkg will be downloaded from their https://github.com/microsoft/vcpkg#security. To configure Vcpkg in this container to access an alternate registry, more information can be found here: Registries: Bring your own libraries to vcpkg.
To update the available library packages, pull the latest from the git repository using the following command in the terminal:
shcd "${VCPKG_ROOT}" git pull --ff-only
Note: Please review the https://github.com/microsoft/vcpkg#license to better understand its own license and additional license information pertaining to library packages and supported ports.
The dev container spec images are maintained in the https://github.com/devcontainers/images repo. You can explore each image and open issues or feature requests.
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See https://github.com/devcontainers/images/blob/main/LICENSE.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 microsoft/devcontainers-cpp 相关的常用 Docker 镜像,适用于 不同场景 等不同场景: