第 4 章 使用 LLVM Toolset 的容器镜像
您可以使用容器文件在 Red Hat Universal Base Images (UBI)容器上构建自己的 LLVM Toolset 容器镜像。
4.1. 使用 LLVM Toolset 创建自定义基于 UBI 的容器 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
LLVM Toolset 软件包是 Red Hat Universal Base Images (UBIs)存储库的一部分。要保持容器镜像大小小,请只安装单个软件包而不是整个 LLVM Toolset。
先决条件
- 现有容器文件。有关创建 Containerfiles 的详情,请参考 Dockerfile 参考 页面。
流程
要创建包含 LLVM Toolset 的容器镜像,请将以下内容添加到容器文件中:
对于基于 RHEL 8 的镜像,请输入:
FROM registry.access.redhat.com/ubi8/ubi:latest RUN yum module install -y llvm-toolset
FROM registry.access.redhat.com/ubi8/ubi:latest RUN yum module install -y llvm-toolset
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 对于基于 RHEL 9 的镜像,请输入:
FROM registry.access.redhat.com/ubi9/ubi:latest RUN yum install -y llvm-toolset
FROM registry.access.redhat.com/ubi9/ubi:latest RUN yum install -y llvm-toolset
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 对于基于 RHEL 10 的镜像,请输入:
FROM registry.access.redhat.com/ubi10/ubi:latest RUN yum install -y llvm-toolset
FROM registry.access.redhat.com/ubi10/ubi:latest RUN yum install -y llvm-toolset
Copy to Clipboard Copied! Toggle word wrap Toggle overflow