轩辕镜像 官方专业版
轩辕镜像
专业版
轩辕镜像 官方专业版
轩辕镜像
专业版
首页个人中心搜索镜像
交易
充值流量¥7起我的订单
文档
工具
提交工单页面收录
clang-concepts

cjdb/clang-concepts

cjdb

A Docker image used to test the clang-concepts-ranges project.

1 次收藏下载次数: 0状态:社区镜像维护者:cjdb仓库类型:镜像最近更新:6 年前
让 AI 帮你使用轩辕镜像? · 展开查看说明 · 点击收起说明

如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。

镜像简介
下载命令
镜像标签列表与下载命令
轩辕镜像,不浪费每一次拉取。
点击查看

Applied Modern C++ Docker Container

Table of Contents

  1. Introduction
    1. Libraries
    2. Tools
      1. Compilers
      2. Linkers
      3. Runtime analysis
      4. Build tools
      5. Other
  2. Installing Docker (please read)
  3. Running a Docker container
    1. Hello, world!
    2. Mounting a volume
      1. Initial steps for Windows 10 with Azure Active Directory only
      2. Initial steps for all Windows 10 users
    3. Interactive mode
    4. Compiling a program
    5. Debugging a program
    6. Using this container on Windows

Introduction

This is a Docker image that aims to have up-to-date C++ libraries and tools for use. Regard for backwards-compatibility is not ***ed.

Libraries

  • Boost
  • https://github.com/ericniebler/range-v3
  • https://github.com/CaseyCarter/cmcstl2
  • https://github.com/catchorg/Catch2
  • https://github.com/Microsoft/GSL

Tools

Compilers

  • GCC 8
  • Clang 7
    • clang-tidy
    • clang-format
    • clang-tools

Linkers

  • ld
  • gold
  • lld 7

Runtime analysis

  • GDB
  • LLDB 7
  • Valgrind
  • AddressSanitizer
  • ThreadSanitizer
  • LeakSanitizer
  • UndefinedBehaviorSanitizer
  • Valgrind

Build tools

  • CMake
  • Conan (profiles included are default (GCC) and clang (uses libc++ and libc++abi))
  • Ninja
  • Make

Other

  • Git
  • Python 3
  • Binutils

Installing Docker (please read)

To install Docker, please be sure to choose the link to the operating system that best suits your laptop. Please be sure to install Docker by following the instructions provided: Docker can often be out-of-date on Linux systems, which exposes security vulnerabilities and can make removing the Docker packages a nightmare.

  • https://docs.docker.com/docker-for-mac/install/
  • https://docs.docker.com/docker-for-windows/install/
  • https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
  • https://docs.docker.com/engine/installation/linux/docker-ce/debian/
  • https://docs.docker.com/engine/installation/linux/docker-ce/centos/
  • https://docs.docker.com/engine/installation/linux/docker-ce/fedora/
  • https://docs.docker.com/engine/installation/linux/docker-ce/binaries/

Note that while I can try to assist, I am not an expert with Docker, and you might be required to post your questions to a forum (please link me if you do so that we both learn).

Running a Docker container

Hello, world!

This is a first Docker program.

  1. Open a terminal. If you're using Windows, please use PowerShell, not Command Prompt or WSL (this will be important later).

  1. Enter the command docker run --rm hello-world into the terminal and press Enter. The following text should appear.

What we've done here is instruct to the Docker that we'd like to run the container called hello-world. The --rm flag tells the Docker daemon to clean up the Docker container once we finish using it, so that it's not hanging around, consuming resources.

Because we didn't have the Docker image already downloaded, the Docker daemon will attempt to download the image from the DockerHub server.

Mounting a volume

In this section, we'll look at exposing a single directory on your computer to the Docker image so that you can interact with the real world. We'll also use this section to download and run amcpp-stdlib for the first time. If you're using Windows, you'll need to do a few extra steps, and if you're using Windows 10 with Azure Active Directory, you'll need to do a few more steps before that.

Initial steps for Windows 10 with Azure Active Directory only

If you don't use Windows 10 with Azure Active Directory, you can skip this step. If you're not sure whether you've got an Active Directory setup, skip this section for now, and if you run into problems

  1. Open Start Menu.
  2. Type 'Add user' and press Enter.
  3. Press 'Add someone else to this PC'.
  4. Press 'I don't have this person's sign-in information'.
  5. Press 'Add a user without a Microsoft account'.
  6. Add a user called 'docker_user', and give them a password that meets your AD password requirements, and save.
  7. Press the newly created 'docker_user', and then select 'Change account type'.
  8. Change 'docker_user' from a Standard User to an Administrator and press OK.
  9. When asked for credentials regarding Docker, you'll need to provide this user and password.
  10. Carry on to 'Initial steps for Windows'.

Note that if you ever delete docker_user or demote docker_user to a standard user, you'll experience problems.

Initial steps for all Windows 10 users

  1. Right-mouse click on the Docker icon in your system tray.
  2. Press 'Settings'.
  3. Select 'Shared Drives'.
  4. Select the drive you wish to share, and press Apply.
  5. You'll likely be asked for credentials (you need to be an administrator to do this step). Provide your user credentials and press OK. If you run into problems trying to authenticate yourself, this means you're either not an admin or you are on an Azure Active Directory installation. If you aren't an administrator, you'll probably just need to have an admin grant you permission. If an admin is having difficulty authenticating, then try the steps above.

Steps for all users

  1. Create a directory called amcpp-stdlib.
  2. Enter the command docker run --rm -v <absolute-path-to-amcpp-stdlib>:/data cjdb/amcpp-stdlib /bin/bash -c 'echo "hello" > /data/hello.txt' You'll see a long list of images being downloaded, and then the prompt should return.
  3. Type cat amcpp-stdlib/hello.txt. The word hello should appear on the line above your prompt.

What we've done here is downloaded and run the container cjdb/amcpp-stdlib, which is the container used in Applied Modern C++. The -v <absolute-path-to-amcpp-stdlib>:/data tells Docker to mount (expose) the directory amcpp-stdlib under the directory /data in the Docker image.

When normally we write something to disk in a Docker container, it's not actually written to disk, and will disappear when we exit the Docker environment. Anything written to this /data directory will be written to your physical disk, and persist until you delete it.

Finally, /bin/bash -c 'echo "hello" > /data/hello.txt' is the command we provide to the Docker container to do work. In this case, we start a shell and write to a file called hello.txt in the special /data directory (which is really an access point to our amcpp-stdlib directory).

Compiling a program

  1. Enter the command docker run --rm -i -t -v <absolute-path-to-amcpp-stdlib>:/data cjdb/amcpp-stdlib.
  2. Instead of getting back your usual prompt, you'll see something like root@b87288407b4a:/#. The -i -t flags have enabled us to enter an interactive mode with pseudo-TTY, so that we can provide many commands to the Docker container, and interleave them with actions such as reading output before making the next command, or more regularly interacting with a program.
  3. Enter the command cd /data && ls && rm hello.txt && ls. You should see hello.txt appear exactly once.
  4. Type the following in, then press Ctrl + D on your keyboard. Mind the newline after the closing brace.
cpp
cat > hello.cpp
#include <iostream>

int main()
{
   std::cout << "Hello, world!\n";
}

  1. Enter the command c++ -Wall -Wextra -Werror -std=c++17 -o hello hello.cpp.
  2. Enter the command ./hello. The message Hello, world! should appear on its own line.
  3. Enter the command clang++ -Wall -Wextra -Werror -std=c++17 -o hello2 hello.cpp.
  4. Enter the command ./hello2. The message Hello, world! should appear on its own line again.
  5. Enter the command exit to return you to your original terminal.

Debugging a program

Docker has certain security mechanisms in place, which make it impossible to run a debugger over a program. In this section, we'll look at how to enable debugging, profiling, and other forms of run-time analysis.

  1. Enter the command docker run --rm --cap-add=SYS_PTRACE -i -t -v <absolute-path-to-amcpp-stdlib>:/data cjdb/amcpp-stdlib. This lets us add the Linux capability of using ptrace, which is used on Linux systems for runtime analysis. Once again, we're in an interactive pseudo-TTY session.
  2. Enter the command cd /data.
  3. Enter the command g++ -Wall -Wextra -Werror -g -o hello hello.cpp.
  4. Enter the command gdb -q hello.
  5. Type r and press Enter to run the program hello.
  6. The text Hello, world! should appear on its own line.
  7. Type q and press Enter to exit GDB.
  8. Enter the command valgrind ./hello. The following should appear.

Using this container on Windows

Docker creates a virtual machine that talks with Windows via the SMB protocol. By default, SMBv3 is used, but unfortunately, there's a bug in the Windows 10 SMBv3 driver that makes it impossible to enact certain developer tools, such as parallel builds and link-time optimisation. This is because when one process is reading a file, it suddenly disappears from the perspective of the entire container. Fortunately, there's a workaround, and that's to get Docker and Windows to communicate via SMBv2. What we'll need to do is create a shared network drive, and share the amcpp-stdlib directory with said network drive.

To enact this workaround, open PowerShell (this is PowerShell-specific), and enter the following commands. There are a few variables that you'll need to set, so don't just copy and paste!

Note: this workaround unfortunately requires that Docker take the password of an administrator and store it as plaintext. This is not ideal. While care has been taken to ensure that your password is not visible in the terminal, no guarantees are made regarding how Docker will handle this data. Follow with caution.

powershell
$username = # the user who shared access to the drive in Docker settings
$path = # path to exposed directory
$volume = # name you want your volume to have

# Share a path across a network.
$volume_name = "amcpp-$volume" # do this to make sure it's more likely to be unique
New-SmbShare -Name "$volume_name" `
	-Path "$path" `
	-FullAccess "$username"

# Get your password (secure)
$secure_password = Read-Host "Enter a password for user account" -AsSecureString

# Convert your password to plaintext
$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($secure_password)
$password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)

$BSTR = $null
$secure_password = $null

# Apply the permission changes to Docker.
docker volume create `
	--driver local `
	--opt type=cifs `
	--opt device="\\$env:computername\$volume_name" `
	--opt o="rw,relatime,vers=2.0,sec=ntlmsspi,cache=strict,username=$username,pass=$password,domain=$env:computername,uid=0,noforceuid,gid=0,noforcegid,addr=10.0.75.1,file_mode=0777,dir_mode=0777,iocharset=utf8,nounix,serverino,mapposix,nobrl,mfsymlinks,noperm,rsize=65536,wsize=65536,echo_interval=60,actimeo=1" `
	"$volume_name"

# Delete the plaintext password
$password = $null

From here-on, provided that $username's password doesn't change, you'll be able to use Docker as though it were a bare-metal machine running Ubuntu 18.04. You should also be able to switch to WSL, if that is your preferred terminal. Now, when you run Docker, you'll need to run it like so: docker run --rm --cap-add=SYS_PTRACE -i -t -v $volumne_name:/data cjdb/amcpp-stdlib. The difference between this and the previous command is that we've replaced the absolute path to the directory with the name of the volume we're sharing.

If you'd like to undo the above, you can run this:

powershell
# Un-apply the permission changes to Docker.
docker volume remove "$volume_name"

# Close the network share
Remove-SmbShare -Name "$volume_name" -Force

Packaging this into a script will reduce the amount of time that you expose your password in plaintext, *** wrapping both segments into a PowerShell script, and running Docker in-between. If you choose to do this, you'll need to use PowerShell at all times.

Acknowledgements

I'd like to thank Morris Hafner for helping debug issues surrounding Conan.io and David Wood for helping me to evaluate the effectiveness of this Docker image. Duncan McBain also provided valuable feedback.

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 clang-concepts 镜像标签

docker pull docker.xuanyuan.run/cjdb/clang-concepts:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull cjdb/clang-concepts:<标签>

轩辕镜像配置手册

按平台快速找到配置文档

一键安装

一键安装 Docker

Linux Docker 一键安装

AI

用 AI 使用轩辕镜像

agents.md · AI 对话 · 提示词

Docker

登录仓库拉取

登录认证 · 私有仓库

专属域名拉取

免登录 · 高速拉取

Linux

Docker 镜像配置

Windows / Mac

Docker Desktop 配置

MacOS OrbStack

OrbStack 容器

Apple Container

macOS 原生容器

Docker Compose

Compose 项目配置

NAS

群晖

Synology 配置

飞牛

fnOS 镜像配置

绿联

绿联 NAS

威联通

QNAP 配置

极空间

极空间 NAS

Unraid

Unraid NAS

企业仓库

其他仓库

ghcr · Quay · nvcr

Harbor 镜像源

Proxy Repository 对接

Portainer 镜像源

Registries 配置

Nexus 镜像源

Docker Proxy 缓存

开发工具

Dev Containers

VS Code 开发容器

Podman

Podman 配置指南

Singularity / Apptainer

HPC 科学计算容器

Kubernetes

K8s Containerd

Kubernetes · Containerd

K3s

轻量级集群

面板 / 网络

爱快路由

爱快 4.0 · iKuai 镜像加速

宝塔面板

一键配置镜像源

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

功能

版本功能对比

功能对比 · 版本选择

支持的镜像仓库

Docker Hub · GCR · GHCR

专属域名用法

专属域名 · 开启停用 · 多仓库

新手拉取配置

登录 · 专属域名 · 配置

docker search 限制

专属域名 · Hub 搜索

不支持 push

仅支持 pull · 不支持

拉取速度原因

带宽 · 缓存 · 冷热镜像

错误码

402 与流量用尽

402 · 流量包 · 充值

401 认证失败

401 · docker login

manifest unknown

标签错误 · 镜像不存在

410 Gone 排查

410 · Docker 升级

429 限流

免费版 · 专业版 · 企业版 · 请求频率

其他报错

DNS 超时

DNS 解析 · 网络超时

TLS 证书失败

no matching manifest(架构)

账号

失败是否计费

manifest · blob · 计费

申请开发票(企业 / 个人)

企业 · 个人 · 工单

修改登录密码

网站 · 仓库 · 重置

注销账户

工单 · 数据 · 注销

原理

mirrors 不生效

daemon.json · 重启

去掉域名前缀

docker tag · 重命名

指定架构拉取

ARM64 · AMD64 · 多架构

latest 与「最新」

digest · 版本号 · 标签

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
cjdb/clang-concepts
定价查看流量套餐与价格
博客Docker 镜像公告与技术博客
专业版 · 高速稳定拉取镜像
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
50GB 仅 ¥7/年
专业版 · 高速稳定拉取镜像
50GB 仅 ¥7/年
高速镜像下载·在线技术支持·99.95% SLA 保障·付费会员免广告
用户协议·隐私政策·增值电信业务经营许可证:浙B2-20261007·©2024-2026 源码跳动©2024-2026 杭州源码跳动科技有限公司·商务合作:点击复制邮箱

更多 clang-concepts 镜像推荐

px4io/px4-dev-clang logo

px4io/px4-dev-clang

px4io
PX4构建环境,包含更新的Clang工具链及SITL仿真支持,提供带ROS和不带ROS的容器选项,适用于PX4固件开发与仿真。
1 次收藏10万+ 次下载
2 年前更新
jetbrains/qodana-clang logo

jetbrains/qodana-clang

jetbrains
暂无描述
1万+ 次下载
6 天前更新
stagex/clang logo

stagex/clang

stagex
A C language family front-end for LLVM
1 次收藏4.2千+ 次下载
1 年前更新
autopas/autopas-build-clang logo

autopas/autopas-build-clang

autopas
提供多种Dockerfile,按任务分类用于构建AutoPas库,支持不同编译器(clang、gcc)、代码覆盖率、CUDA、文档生成等需求,无需安装依赖即可使用,适用于开发和测试环境。
1 次收藏1万+ 次下载
7 个月前更新
stagex/core-clang logo

stagex/core-clang

stagex
暂无描述
3.4千+ 次下载
27 天前更新
px4io/px4-dev-nuttx-clang logo

px4io/px4-dev-nuttx-clang

px4io
PX4 NuttX + Clang开发环境,提供PX4工具链和SITL仿真支持,包含带ROS和不带ROS的容器选项。
4.4千+ 次下载
2 年前更新

查看更多 clang-concepts 相关镜像