class DockerImage
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.StepFunctions.Tasks.DockerImage |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctionstasks#DockerImage |
Java | software.amazon.awscdk.services.stepfunctions.tasks.DockerImage |
Python | aws_cdk.aws_stepfunctions_tasks.DockerImage |
TypeScript (source) | aws-cdk-lib » aws_stepfunctions_tasks » DockerImage |
Creates IDockerImage
instances.
Example
new tasks.SageMakerCreateModel(this, 'Sagemaker', {
modelName: 'MyModel',
primaryContainer: new tasks.ContainerDefinition({
image: tasks.DockerImage.fromJsonExpression(sfn.JsonPath.stringAt('$.Model.imageName')),
mode: tasks.Mode.SINGLE_MODEL,
modelS3Location: tasks.S3Location.fromJsonExpression('$.TrainingJob.ModelArtifacts.S3ModelArtifacts'),
}),
});
Initializer
new DockerImage()
Methods
Name | Description |
---|---|
bind(task) | Called when the image is used by a SageMaker task. |
static from | Reference a Docker image that is provided as an Asset in the current app. |
static from | Reference a Docker image stored in an ECR repository. |
static from | Reference a Docker image which URI is obtained from the task's input. |
static from | Reference a Docker image by it's URI. |
bind(task)
public bind(task: ISageMakerTask): DockerImageConfig
Parameters
- task
ISage
Maker Task
Returns
Called when the image is used by a SageMaker task.
Asset(scope, id, props)
static frompublic static fromAsset(scope: Construct, id: string, props: DockerImageAssetProps): DockerImage
Parameters
- scope
Construct
— the scope in which to create the Asset. - id
string
— the ID for the asset in the construct tree. - props
Docker
— the configuration props of the asset.Image Asset Props
Returns
Reference a Docker image that is provided as an Asset in the current app.
EcrRepository(repository, tagOrDigest?)
static frompublic static fromEcrRepository(repository: IRepository, tagOrDigest?: string): DockerImage
Parameters
- repository
IRepository
— the ECR repository where the image is hosted. - tagOrDigest
string
— an optional tag or digest (digests must start withsha256:
).
Returns
Reference a Docker image stored in an ECR repository.
JsonExpression(expression, allowAnyEcrImagePull?)
static frompublic static fromJsonExpression(expression: string, allowAnyEcrImagePull?: boolean): DockerImage
Parameters
- expression
string
— the JSON path expression with the task input. - allowAnyEcrImagePull
boolean
— whether ECR access should be permitted (set tofalse
if the image will never be in ECR).
Returns
Reference a Docker image which URI is obtained from the task's input.
Registry(imageUri)
static frompublic static fromRegistry(imageUri: string): DockerImage
Parameters
- imageUri
string
— the URI to the docker image.
Returns
Reference a Docker image by it's URI.
When referencing ECR images, prefer using inEcr
.