Class DockerImage
Creates IDockerImage
instances.
Namespace: Amazon.CDK.AWS.StepFunctions.Tasks
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class DockerImage : DeputyBase
Syntax (vb)
Public MustInherit Class DockerImage Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
new SageMakerCreateModel(this, "Sagemaker", new SageMakerCreateModelProps {
ModelName = "MyModel",
PrimaryContainer = new ContainerDefinition(new ContainerDefinitionOptions {
Image = DockerImage.FromJsonExpression(JsonPath.StringAt("$.Model.imageName")),
Mode = Mode.SINGLE_MODEL,
ModelS3Location = S3Location.FromJsonExpression("$.TrainingJob.ModelArtifacts.S3ModelArtifacts")
})
});
Synopsis
Constructors
DockerImage() | Creates |
Methods
Bind(ISageMakerTask) | Called when the image is used by a SageMaker task. |
FromAsset(Construct, string, IDockerImageAssetProps) | Reference a Docker image that is provided as an Asset in the current app. |
FromEcrRepository(IRepository, string?) | Reference a Docker image stored in an ECR repository. |
FromJsonExpression(string, bool?) | Reference a Docker image which URI is obtained from the task's input. |
FromRegistry(string) | Reference a Docker image by it's URI. |
Constructors
DockerImage()
Creates IDockerImage
instances.
protected DockerImage()
Remarks
ExampleMetadata: infused
Examples
new SageMakerCreateModel(this, "Sagemaker", new SageMakerCreateModelProps {
ModelName = "MyModel",
PrimaryContainer = new ContainerDefinition(new ContainerDefinitionOptions {
Image = DockerImage.FromJsonExpression(JsonPath.StringAt("$.Model.imageName")),
Mode = Mode.SINGLE_MODEL,
ModelS3Location = S3Location.FromJsonExpression("$.TrainingJob.ModelArtifacts.S3ModelArtifacts")
})
});
Methods
Bind(ISageMakerTask)
Called when the image is used by a SageMaker task.
public abstract IDockerImageConfig Bind(ISageMakerTask task)
Parameters
- task ISageMakerTask
Returns
Remarks
ExampleMetadata: infused
FromAsset(Construct, string, IDockerImageAssetProps)
Reference a Docker image that is provided as an Asset in the current app.
public static DockerImage FromAsset(Construct scope, string id, IDockerImageAssetProps props)
Parameters
- scope Construct
the scope in which to create the Asset.
- id string
the ID for the asset in the construct tree.
- props IDockerImageAssetProps
the configuration props of the asset.
Returns
Remarks
ExampleMetadata: infused
FromEcrRepository(IRepository, string?)
Reference a Docker image stored in an ECR repository.
public static DockerImage FromEcrRepository(IRepository repository, string? tagOrDigest = null)
Parameters
- repository IRepository
the ECR repository where the image is hosted.
- tagOrDigest string
an optional tag or digest (digests must start with
sha256:
).
Returns
Remarks
ExampleMetadata: infused
FromJsonExpression(string, bool?)
Reference a Docker image which URI is obtained from the task's input.
public static DockerImage FromJsonExpression(string expression, bool? allowAnyEcrImagePull = null)
Parameters
- expression string
the JSONata or JSON path expression with the task input.
- allowAnyEcrImagePull bool?
whether ECR access should be permitted (set to
false
if the image will never be in ECR).
Returns
Remarks
ExampleMetadata: infused
FromRegistry(string)
Reference a Docker image by it's URI.
public static DockerImage FromRegistry(string imageUri)
Parameters
- imageUri string
the URI to the docker image.
Returns
Remarks
When referencing ECR images, prefer using inEcr
.