更新时间:2024-04-30 GMT+08:00

加载镜像构建模板

ma-cli可以使用add-template命令将镜像模板加载到指定文件夹下,默认路径为当前命令所在的路径。

比如${current_dir}/.ma/${template_name}/。也可以通过--dest命令指定保存的路径。当保存的路径已经有同名的模板文件夹时,可以使用--force | -f参数进行强制覆盖。

$ ma-cli image add-template -h
Usage: ma-cli image add-template [OPTIONS] TEMPLATE_NAME

  Add buildin dockerfile templates into disk.

  Example:

  # List build-in dockerfile templates
  ma-cli image add-template customize_from_ubuntu_18.04_to_modelarts --force

Options:
  --dst TEXT          target save path.
  -f, --force         Override templates that has been installed.
  -D, --debug         Debug Mode. Shows full stack trace when error occurs.
  -P, --profile TEXT  CLI connection profile to use. The default profile is "DEFAULT".
  -h, -H, --help      Show this message and exit.
表1 参数说明

参数名

参数类型

是否必选

参数说明

--dst

String

加载模板到指定路径,默认是当前路径。

-f / --force

Bool

是否强制覆盖已存在的同名模板,默认不覆盖。

示例

加载customize_from_ubuntu_18.04_to_modelarts镜像构建模板。

ma-cli image add-template customize_from_ubuntu_18.04_to_modelarts