Skip to content

build-dockerfile

Automatically generated README for this automation recipe: build-dockerfile

Category: Docker automation

License: Apache 2.0

  • Notes from the authors, contributors and users: README-extra

  • CM meta description for this script: _cm.yaml

  • Output cached? False

Reuse this script in your project

Install MLCommons CM automation meta-framework

Pull CM repository with this automation recipe (CM script)

cm pull repo mlcommons@cm4mlops

cmr "build dockerfile" --help

Run this script

Run this script via CLI
cm run script --tags=build,dockerfile[,variations] [--input_flags]
Run this script via CLI (alternative)
cmr "build dockerfile [variations]" [--input_flags]
Run this script from Python
import cmind

r = cmind.access({'action':'run'
              'automation':'script',
              'tags':'build,dockerfile'
              'out':'con',
              ...
              (other input keys for this script)
              ...
             })

if r['return']>0:
    print (r['error'])
Run this script via Docker (beta)
cm docker script "build dockerfile[variations]" [--input_flags]

Variations

  • No group (any combination of variations can be selected)

    Click here to expand this section.

    • _slim
      • ENV variables:
        • CM_DOCKER_BUILD_SLIM: yes

Script flags mapped to environment

  • --build=valueCM_BUILD_DOCKER_IMAGE=value
  • --cache=valueCM_DOCKER_CACHE=value
  • --cm_repo=valueCM_MLOPS_REPO=value
  • --cm_repo_flags=valueCM_DOCKER_ADD_FLAG_TO_CM_MLOPS_REPO=value
  • --cm_repos=valueCM_DOCKER_EXTRA_CM_REPOS=value
  • --comments=valueCM_DOCKER_RUN_COMMENTS=value
  • --copy_files=valueCM_DOCKER_COPY_FILES=value
  • --docker_base_image=valueCM_DOCKER_IMAGE_BASE=value
  • --docker_os=valueCM_DOCKER_OS=value
  • --docker_os_version=valueCM_DOCKER_OS_VERSION=value
  • --extra_sys_deps=valueCM_DOCKER_EXTRA_SYS_DEPS=value
  • --fake_docker_deps=valueCM_DOCKER_FAKE_DEPS=value
  • --fake_run_option=valueCM_DOCKER_FAKE_RUN_OPTION=value
  • --file_path=valueCM_DOCKERFILE_WITH_PATH=value
  • --gh_token=valueCM_GH_TOKEN=value
  • --image_repo=valueCM_DOCKER_IMAGE_REPO=value
  • --image_tag=valueCM_DOCKER_IMAGE_TAG=value
  • --package_manager_update_cmd=valueCM_PACKAGE_MANAGER_UPDATE_CMD=value
  • --pip_extra_flags=valueCM_DOCKER_PIP_INSTALL_EXTRA_FLAGS=value
  • --post_file=valueDOCKER_IMAGE_POST_FILE=value
  • --post_run_cmds=valueCM_DOCKER_POST_RUN_COMMANDS=value
  • --pre_run_cmds=valueCM_DOCKER_PRE_RUN_COMMANDS=value
  • --push_image=valueCM_DOCKER_PUSH_IMAGE=value
  • --real_run=valueCM_REAL_RUN=value
  • --run_cmd=valueCM_DOCKER_RUN_CMD=value
  • --run_cmd_extra=valueCM_DOCKER_RUN_CMD_EXTRA=value
  • --script_tags=valueCM_DOCKER_RUN_SCRIPT_TAGS=value
  • --skip_cm_sys_upgrade=valueCM_DOCKER_SKIP_CM_SYS_UPGRADE=value

Default environment

These keys can be updated via --env.KEY=VALUE or env dictionary in @input.json or using script flags.

  • CM_DOCKER_BUILD_SLIM: no
  • CM_DOCKER_IMAGE_EOL: `

* CM_DOCKER_OS:ubuntu`


Script output

cmr "build dockerfile [variations]" [--input_flags] -j