82.2. tripleo 容器镜像构建


使用 tripleo-ansible 构建 tripleo 容器镜像。

使用方法:

openstack tripleo container image build [-h] [--authfile <authfile>]
                                               [--base <base-image>]
                                               [--config-file <config-file>]
                                               [--config-path <config-path>]
                                               [--distro <distro>]
                                               [--tcib-extras <key=val>]
                                               [--exclude <container-name>]
                                               [--extra-config <extra-config>]
                                               [--namespace <registry-namespace>]
                                               [--registry <registry-url>]
                                               [--skip-build]
                                               [--tag <image-tag>]
                                               [--prefix <image-prefix>]
                                               [--push] [--label <label-data>]
                                               [--volume <volume-path>]
                                               [--repo-dir <repo-dir>]
                                               [--work-dir <work-directory>]
                                               [--rhel-modules <rhel-modules>]
                                               [--build-timeout <build timeout in seconds>]
Copy to Clipboard Toggle word wrap

Expand
表 82.2. 命令参数
valueSummary

-h, --help

显示帮助信息并退出

--authfile <authfile>

身份验证文件的路径。使用 REGISTRY_AUTH_FILE 环境变量覆盖。(默认为 /root/containers/auth.json)

--base <base-image>

基本镜像名称,带有可选版本。可以是 centos:8,基础名称镜像将是 centos,但 centos:8 将拉取以构建基础镜像。(默认为 ubi8)

--config-file <config-file>

yaml 配置文件指定要构建的镜像。(默认为 tripleo_containers.yaml)

--config-path <config-path>

基本配置路径。这是所有 container-image 文件的基本路径。定义的容器必须位于此路径的 tcib 文件夹中。如果设置了这个选项,则修改 <config-file> 的默认路径。(默认为 /usr/share/tripleo- common/container-images)

--distro <distro>

distro 名称,如果未定义,系统将使用主机 distro 进行构建(默认:centos)

--tcib-extras <key=val>

您要传递的 Tcib 额外变量。它们稍后可在 TCIB 文件中用作 conditonals。可以多次传递(默认:无)

--exclude <container-name>

要构建的容器列表匹配的容器名称。在跳过多个容器时应多次指定。(默认值:[])

--extra-config <extra-config>

从给定的配置 YAML 文件中应用附加选项。这将适用于构建的所有容器。(默认值: None)

--namespace <registry-namespace>

容器 registry 命名空间(默认: tripleomaster)

--registry <registry-url>

容器 registry url (默认:localhost)

--skip-build

跳过或不是镜像的构建(默认为 false)

--tag <image-tag>

镜像标签(默认值:latest)

--prefix <image-prefix>

镜像前缀。(默认值:openstack)

--push

启用镜像推送到给定的 registry。(默认值:False)

--label <label-data>

向容器添加标签。此选项可多次指定。每个标签都是 key=value 对。

--volume <volume-path>

构建镜像时使用的容器绑定挂载。如果有多个卷,则应多次指定。(默认:[/etc/pki/rpm-gpg:/etc/pki/rpm- gpg:z])

--repo-dir <repo-dir>

定义包含存储库文件的自定义目录。这在从不同的操作系统版本构建容器时很有用。

--work-dir <work-directory>

tripleo 容器构建目录,存储各个镜像及其依赖项的配置和日志。(默认:/tmp/container-builds)

--rhel-modules <rhel-modules>

以逗号分隔的 rhel 模块列表及其版本。示例: mariadb:10.3,virt:8.3

--build-timeout <build timeout in seconds>

构建超时(以秒为单位)。

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat