Updated on 2024-06-12 GMT+08:00

Loading an Image Creation Template

The add-template command is used to load image templates to a specified folder. By default, the path where the current command is located is used,

for example, ${current_dir}/.ma/${template_name}/. You can also run the --dest command to specify the path. If a template folder with the same name already exists in the target path, run the --force | -f parameter to forcibly overwrite the existing template folder.

$ 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.
Table 1 Parameters

Parameter

Type

Mandatory

Description

--dst

String

No

Load templates to a specified path. The current path is used by default.

-f / --force

Bool

No

Whether to forcibly overwrite an existing template with the same name. By default, the template is not overwritten.

Examples

Load the customize_from_ubuntu_18.04_to_modelarts image creation template.

ma-cli image add-template customize_from_ubuntu_18.04_to_modelarts