@Generated(value="jsii-pacmak/1.70.0 (build 03c2f6f)", date="2022-11-01T13:16:47.483Z") @Stability(value=Experimental) public abstract class ContainerImage extends software.amazon.jsii.JsiiObject
Example:
Vpc vpc;
Cluster cluster = Cluster.Builder.create(this, "FargateCPCluster")
.vpc(vpc)
.enableFargateCapacityProviders(true)
.build();
FargateTaskDefinition taskDefinition = new FargateTaskDefinition(this, "TaskDef");
taskDefinition.addContainer("web", ContainerDefinitionOptions.builder()
.image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
.build());
FargateService.Builder.create(this, "FargateService")
.cluster(cluster)
.taskDefinition(taskDefinition)
.capacityProviderStrategies(List.of(CapacityProviderStrategy.builder()
.capacityProvider("FARGATE_SPOT")
.weight(2)
.build(), CapacityProviderStrategy.builder()
.capacityProvider("FARGATE")
.weight(1)
.build()))
.build();
| Modifier | Constructor and Description |
|---|---|
protected |
ContainerImage() |
protected |
ContainerImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ContainerImage(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
abstract ContainerImageConfig |
bind(Construct scope,
ContainerDefinition containerDefinition)
(experimental) Called when the image is used by a ContainerDefinition.
|
static AssetImage |
fromAsset(String directory)
(experimental) Reference an image that's constructed directly from sources on disk.
|
static AssetImage |
fromAsset(String directory,
AssetImageProps props)
(experimental) Reference an image that's constructed directly from sources on disk.
|
static ContainerImage |
fromDockerImageAsset(DockerImageAsset asset)
(experimental) Use an existing `DockerImageAsset` for this container image.
|
static EcrImage |
fromEcrRepository(IRepository repository)
(experimental) Reference an image in an ECR repository.
|
static EcrImage |
fromEcrRepository(IRepository repository,
String tag)
(experimental) Reference an image in an ECR repository.
|
static RepositoryImage |
fromRegistry(String name)
(experimental) Reference an image on DockerHub or another online registry.
|
static RepositoryImage |
fromRegistry(String name,
RepositoryImageProps props)
(experimental) Reference an image on DockerHub or another online registry.
|
static ContainerImage |
fromTarball(String tarballFile)
(experimental) Use an existing tarball for this container image.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected ContainerImage(software.amazon.jsii.JsiiObjectRef objRef)
protected ContainerImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental) protected ContainerImage()
@Stability(value=Experimental) @NotNull public static AssetImage fromAsset(@NotNull String directory, @Nullable AssetImageProps props)
If you already have a DockerImageAsset instance, you can use the
ContainerImage.fromDockerImageAsset method instead.
directory - The directory containing the Dockerfile. This parameter is required.props - @Stability(value=Experimental) @NotNull public static AssetImage fromAsset(@NotNull String directory)
If you already have a DockerImageAsset instance, you can use the
ContainerImage.fromDockerImageAsset method instead.
directory - The directory containing the Dockerfile. This parameter is required.@Stability(value=Experimental) @NotNull public static ContainerImage fromDockerImageAsset(@NotNull DockerImageAsset asset)
asset - The `DockerImageAsset` to use for this container definition. This parameter is required.@Stability(value=Experimental) @NotNull public static EcrImage fromEcrRepository(@NotNull IRepository repository, @Nullable String tag)
repository - This parameter is required.tag - @Stability(value=Experimental) @NotNull public static EcrImage fromEcrRepository(@NotNull IRepository repository)
repository - This parameter is required.@Stability(value=Experimental) @NotNull public static RepositoryImage fromRegistry(@NotNull String name, @Nullable RepositoryImageProps props)
name - This parameter is required.props - @Stability(value=Experimental) @NotNull public static RepositoryImage fromRegistry(@NotNull String name)
name - This parameter is required.@Stability(value=Experimental) @NotNull public static ContainerImage fromTarball(@NotNull String tarballFile)
Use this method if the container image has already been created by another process (e.g. jib) and you want to add it as a container image asset.
tarballFile - Absolute path to the tarball. This parameter is required.@Stability(value=Experimental) @NotNull public abstract ContainerImageConfig bind(@NotNull Construct scope, @NotNull ContainerDefinition containerDefinition)
scope - This parameter is required.containerDefinition - This parameter is required.Copyright © 2022. All rights reserved.