2.6. 可选的 build 命令参数
-t 标志将使用特定名称标记您的自动化执行环境镜像。例如,以下命令将构建名为 my_first_ee_image 的镜像:
ansible-builder build -t my_first_ee_image
$ ansible-builder build -t my_first_ee_image
注意
如果您在构建中没有使用 -t,则创建名为 ansible-execution-env' 的镜像,并加载到本地容器 registry 中。
如果您有多个定义文件,可以通过包含 -f 标志来指定要使用的文件:
ansible-builder build -f another-definition-file.yml -t another_ee_image
$ ansible-builder build -f another-definition-file.yml -t another_ee_image
在本例中, Ansible Builder 将使用名为 another-definition-file.yml 的文件中提供的规格,而不是默认的 execution-environment.yml 来构建名为 another_ee_image 的自动化执行环境镜像。
有关可用于 build 命令的其他规格和标志,请输入 ansible-builder build --help 来查看附加选项列表。