DockerBuildContext 类

定义 Docker 生成上下文。

类 DockerBuildContext 构造函数。

继承
azureml._base_sdk_common.abstract_run_config_element._AbstractRunConfigElement
DockerBuildContext

构造函数

DockerBuildContext(location_type=None, location=None, dockerfile_path='Dockerfile')

参数

location_type
默认值: None
location
默认值: None
dockerfile_path
默认值: Dockerfile

变量

azureml.core.environment.DockerBuildContext.location_type

Docker 生成上下文位置的类型

azureml.core.environment.DockerBuildContext.location

Docker 生成上下文位置。

dockerfile_path
str

相对于生成上下文根目录的 Dockerfile 的路径,默认为 Dockerfile。

方法

from_local_directory

从包含 Docker 生成上下文的本地目录创建 DockerBuildContext 对象。

from_local_directory

从包含 Docker 生成上下文的本地目录创建 DockerBuildContext 对象。

static from_local_directory(workspace, path, dockerfile_path='Dockerfile')

参数

workspace
Workspace
必需

将在其中创建环境的工作区。

path
str
必需

包含 Docker 生成上下文的目录的路径。

dockerfile_path
str
默认值: Dockerfile

相对于 Docker 生成上下文根目录的 Dockerfile 路径,默认为 Dockerfile。

返回

DockerBuildContext 对象。

返回类型