第 4 章 在 RHEL 8 上使用 LLVM Toolset 的容器镜像
在 RHEL 8 中,您可以使用 Containerfiles 在 Red Hat Universal Base Images (UBI)容器之上构建自己的 LLVM Toolset 容器镜像。
4.1. 在 RHEL 8 上创建 LLVM Toolset 的容器镜像 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
在 RHEL 8 中,LLVM Toolset 软件包是 Red Hat Universal Base Images (UBI)存储库的一部分。要保持容器镜像大小小,请只安装单独的软件包而不是整个 LLVM Toolset。
先决条件
-
现有的 Containerfile。
有关创建 Containerfiles 的详情,请参考 Dockerfile 参考 页面。
流程
- 访问 红帽容器目录。
- 选择 UBI。
- 点 Get this image 并按照说明进行操作。
- 要创建包含 LLVM Toolset 的容器镜像,请在 Containerfile 中添加以下行:
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
要创建仅包含单个软件包的容器镜像,请在 Containerfile 中添加以下行:
RUN yum install -y <package-name>
RUN yum install -y <package-name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
将 <
package-name
> 替换为您要安装的软件包的名称。
-
将 <