@Generated(value="jsii-pacmak/1.57.0 (build f614666)", date="2022-04-22T09:30:45.974Z") @Stability(value=Stable) public class LinuxBuildImage extends software.amazon.jsii.JsiiObject implements IBuildImage
This class has a bunch of public constants that represent the most popular images.
You can also specify a custom image using one of the static methods:
Example:
CodePipeline pipeline = CodePipeline.Builder.create(this, "Pipeline") .synth(ShellStep.Builder.create("Synth") .input(CodePipelineSource.connection("my-org/my-app", "main", ConnectionSourceOptions.builder() .connectionArn("arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41") .build())) .commands(List.of("npm ci", "npm run build", "npx cdk synth")) .build()) // Turn this on because the pipeline uses Docker image assets .dockerEnabledForSelfMutation(true) .build(); pipeline.addWave("MyWave", WaveOptions.builder() .post(List.of( CodeBuildStep.Builder.create("RunApproval") .commands(List.of("command-from-image")) .buildEnvironment(BuildEnvironment.builder() // The user of a Docker image asset in the pipeline requires turning on // 'dockerEnabledForSelfMutation'. .buildImage(LinuxBuildImage.fromAsset(this, "Image", DockerImageAssetProps.builder() .directory("./docker-image") .build())) .build()) .build())) .build());
https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
software.amazon.jsii.JsiiObject.InitializationMode
IBuildImage.Jsii$Default, IBuildImage.Jsii$Proxy
Modifier and Type | Field and Description |
---|---|
static IBuildImage |
AMAZON_LINUX_2 |
static IBuildImage |
AMAZON_LINUX_2_2 |
static IBuildImage |
AMAZON_LINUX_2_3
The Amazon Linux 2 x86_64 standard image, version `3.0`.
|
static IBuildImage |
AMAZON_LINUX_2_ARM
Deprecated.
Use LinuxArmBuildImage.AMAZON_LINUX_2_STANDARD_1_0 instead.
|
static IBuildImage |
AMAZON_LINUX_2_ARM_2
Deprecated.
Use LinuxArmBuildImage.AMAZON_LINUX_2_STANDARD_2_0 instead.
|
static IBuildImage |
STANDARD_1_0 |
static IBuildImage |
STANDARD_2_0 |
static IBuildImage |
STANDARD_3_0 |
static IBuildImage |
STANDARD_4_0
The `aws/codebuild/standard:4.0` build image.
|
static IBuildImage |
STANDARD_5_0
The `aws/codebuild/standard:5.0` build image.
|
Modifier | Constructor and Description |
---|---|
protected |
LinuxBuildImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
LinuxBuildImage(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
static IBuildImage |
fromAsset(software.constructs.Construct scope,
String id,
DockerImageAssetProps props)
Uses an Docker image asset as a x86-64 Linux build image.
|
static IBuildImage |
fromCodeBuildImageId(String id)
Uses a Docker image provided by CodeBuild.
|
static IBuildImage |
fromDockerRegistry(String name) |
static IBuildImage |
fromDockerRegistry(String name,
DockerImageOptions options) |
static IBuildImage |
fromEcrRepository(IRepository repository) |
static IBuildImage |
fromEcrRepository(IRepository repository,
String tagOrDigest) |
ComputeType |
getDefaultComputeType()
The default
ComputeType to use with this image, if one was not specified in BuildEnvironment#computeType explicitly. |
String |
getImageId()
The Docker image identifier that the build environment uses.
|
ImagePullPrincipalType |
getImagePullPrincipalType()
The type of principal that CodeBuild will use to pull this build Docker image.
|
IRepository |
getRepository()
An optional ECR repository that the image is hosted in.
|
ISecret |
getSecretsManagerCredentials()
The secretsManagerCredentials for access to a private registry.
|
String |
getType()
The type of build environment.
|
BuildSpec |
runScriptBuildspec(String entrypoint)
Make a buildspec to run the indicated script.
|
List<String> |
validate(BuildEnvironment _)
Allows the image a chance to validate whether the passed configuration is correct.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
@Stability(value=Stable) public static final IBuildImage AMAZON_LINUX_2
@Stability(value=Stable) public static final IBuildImage AMAZON_LINUX_2_2
@Stability(value=Stable) public static final IBuildImage AMAZON_LINUX_2_3
@Stability(value=Deprecated) @Deprecated public static final IBuildImage AMAZON_LINUX_2_ARM
@Stability(value=Deprecated) @Deprecated public static final IBuildImage AMAZON_LINUX_2_ARM_2
@Stability(value=Stable) public static final IBuildImage STANDARD_1_0
@Stability(value=Stable) public static final IBuildImage STANDARD_2_0
@Stability(value=Stable) public static final IBuildImage STANDARD_3_0
@Stability(value=Stable) public static final IBuildImage STANDARD_4_0
@Stability(value=Stable) public static final IBuildImage STANDARD_5_0
protected LinuxBuildImage(software.amazon.jsii.JsiiObjectRef objRef)
protected LinuxBuildImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) @NotNull public static IBuildImage fromAsset(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DockerImageAssetProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.@Stability(value=Stable) @NotNull public static IBuildImage fromCodeBuildImageId(@NotNull String id)
Example:
"aws/codebuild/standard:4.0";
id
- The image identifier. This parameter is required.https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
@Stability(value=Stable) @NotNull public static IBuildImage fromDockerRegistry(@NotNull String name, @Nullable DockerImageOptions options)
name
- This parameter is required.options
- @Stability(value=Stable) @NotNull public static IBuildImage fromDockerRegistry(@NotNull String name)
name
- This parameter is required.@Stability(value=Stable) @NotNull public static IBuildImage fromEcrRepository(@NotNull IRepository repository, @Nullable String tagOrDigest)
repository
- The ECR repository. This parameter is required.tagOrDigest
- Image tag or digest (default "latest", digests must start with `sha256:`).https://docs.aws.amazon.com/codebuild/latest/userguide/sample-ecr.html
@Stability(value=Stable) @NotNull public static IBuildImage fromEcrRepository(@NotNull IRepository repository)
repository
- The ECR repository. This parameter is required.https://docs.aws.amazon.com/codebuild/latest/userguide/sample-ecr.html
@Stability(value=Stable) @NotNull public BuildSpec runScriptBuildspec(@NotNull String entrypoint)
runScriptBuildspec
in interface IBuildImage
entrypoint
- This parameter is required.@Stability(value=Stable) @NotNull public List<String> validate(@NotNull BuildEnvironment _)
validate
in interface IBuildImage
_
- This parameter is required.@Stability(value=Stable) @NotNull public ComputeType getDefaultComputeType()
ComputeType
to use with this image, if one was not specified in BuildEnvironment#computeType
explicitly.getDefaultComputeType
in interface IBuildImage
@Stability(value=Stable) @NotNull public String getImageId()
getImageId
in interface IBuildImage
https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
@Stability(value=Stable) @NotNull public String getType()
getType
in interface IBuildImage
@Stability(value=Stable) @Nullable public ImagePullPrincipalType getImagePullPrincipalType()
getImagePullPrincipalType
in interface IBuildImage
@Stability(value=Stable) @Nullable public IRepository getRepository()
getRepository
in interface IBuildImage
@Stability(value=Stable) @Nullable public ISecret getSecretsManagerCredentials()
getSecretsManagerCredentials
in interface IBuildImage
Copyright © 2022. All rights reserved.