class BaseContainerImage
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ImageBuilder.Alpha.BaseContainerImage |
Go | github.com/aws/aws-cdk-go/awsimagebuilderalpha/v2#BaseContainerImage |
Java | software.amazon.awscdk.services.imagebuilder.alpha.BaseContainerImage |
Python | aws_cdk.aws_imagebuilder_alpha.BaseContainerImage |
TypeScript (source) | @aws-cdk/aws-imagebuilder-alpha ยป BaseContainerImage |
Represents a base image that is used to start from in EC2 Image Builder image builds.
Example
const parameterizedComponent = imagebuilder.Component.fromComponentName(
this,
'ParameterizedComponent',
'my-parameterized-component'
);
const imageRecipe = new imagebuilder.ImageRecipe(this, 'ParameterizedImageRecipe', {
baseImage: imagebuilder.BaseImage.fromSsmParameterName(
'/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64'
),
components: [
{
component: parameterizedComponent,
parameters: {
environment: imagebuilder.ComponentParameterValue.fromString('production'),
version: imagebuilder.ComponentParameterValue.fromString('1.0.0')
}
}
]
});
Initializer (protected)
super(image: string)
Parameters
- image
string
Properties
| Name | Type | Description |
|---|---|---|
| image | string | The rendered base image to use. |
image
Type:
string
The rendered base image to use.
Methods
| Name | Description |
|---|---|
| static from | The DockerHub image to use as the base image in a container recipe. |
| static from | The ECR container image to use as the base image in a container recipe. |
| static from | The ECR public container image to use as the base image in a container recipe. |
| static from | The EC2 Image Builder image to use as a base image in a container recipe. |
| static from | The string value of the base image to use in a container recipe. |
static fromDockerHub(repository, tag)
public static fromDockerHub(repository: string, tag: string): BaseContainerImage
Parameters
- repository
stringโ The DockerHub repository where the base image resides in. - tag
stringโ The tag of the base image in the DockerHub repository.
Returns
The DockerHub image to use as the base image in a container recipe.
static fromEcr(repository, tag)
public static fromEcr(repository: IRepository, tag: string): BaseContainerImage
Parameters
- repository
IRepositoryโ The ECR repository where the base image resides in. - tag
stringโ The tag of the base image in the ECR repository.
Returns
The ECR container image to use as the base image in a container recipe.
static fromEcrPublic(registryAlias, repositoryName, tag)
public static fromEcrPublic(registryAlias: string, repositoryName: string, tag: string): BaseContainerImage
Parameters
- registryAlias
stringโ The alias of the ECR public registry where the base image resides in. - repositoryName
stringโ The name of the ECR public repository, where the base image resides in. - tag
stringโ The tag of the base image in the ECR public repository.
Returns
The ECR public container image to use as the base image in a container recipe.
static fromImage(image)
public static fromImage(image: IImage): BaseContainerImage
Parameters
- image
IImageโ The EC2 Image Builder image to use as a base image.
Returns
The EC2 Image Builder image to use as a base image in a container recipe.
static fromString(baseContainerImageString)
public static fromString(baseContainerImageString: string): BaseContainerImage
Parameters
- baseContainerImageString
stringโ The base image as a direct string value.
Returns
The string value of the base image to use in a container recipe.
This can be an EC2 Image Builder image ARN, an ECR or ECR public image, or a container URI sourced from a third-party container registry such as DockerHub.

.NET
Go
Java
Python
TypeScript (