第 3 章 常见自动化执行环境场景


使用以下示例定义文件来解决常见配置场景。

3.1. 更新自动化中心 CA 证书

使用本示例自定义默认定义文件,将 CA 证书包含到 additional-build-files 部分,将该文件移到适当的目录中,最后运行 命令来更新 CA 证书的动态配置,以允许系统信任此 CA 证书。

先决条件

  • 自定义 CA 证书,如 rootCA.crt
注意

使用 prepend_base 自定义 CA 证书意味着生成的 CA 配置出现在所有其他构建阶段和最终镜像中,因为所有其他构建阶段都继承自基础镜像。

additional_build_files:
  # copy the CA public key into the build context, we will copy and use it in the base image later
  - src: files/rootCA.crt
    dest: configs

additional_build_steps:
  prepend_base:
    # copy a custom CA cert into the base image and recompute the trust database
    # because this is in "base", all stages will inherit (including the final EE)
    - COPY _build/configs/rootCA.crt /usr/share/pki/ca-trust-source/anchors
    - RUN update-ca-trust

options:
  package_manager_path: /usr/bin/microdnf  # downstream images use non-standard package manager

[galaxy]
server_list = automation_hub
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat