Class LinuxBuildImage
A CodeBuild image running x86-64 Linux.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.CodeBuild
Assembly: Amazon.CDK.AWS.CodeBuild.dll
Syntax (csharp)
public class LinuxBuildImage : DeputyBase, IBuildImage
Syntax (vb)
Public Class LinuxBuildImage
Inherits DeputyBase
Implements IBuildImage
Remarks
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:
See: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
ExampleMetadata: infused
Examples
var pipeline = new CodePipeline(this, "Pipeline", new CodePipelineProps {
Synth = new ShellStep("Synth", new ShellStepProps {
Input = CodePipelineSource.Connection("my-org/my-app", "main", new ConnectionSourceOptions {
ConnectionArn = "arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41"
}),
Commands = new [] { "npm ci", "npm run build", "npx cdk synth" }
}),
// Turn this on because the pipeline uses Docker image assets
DockerEnabledForSelfMutation = true
});
pipeline.AddWave("MyWave", new WaveOptions {
Post = new [] {
new CodeBuildStep("RunApproval", new CodeBuildStepProps {
Commands = new [] { "command-from-image" },
BuildEnvironment = new BuildEnvironment {
// The user of a Docker image asset in the pipeline requires turning on
// 'dockerEnabledForSelfMutation'.
BuildImage = LinuxBuildImage.FromAsset(this, "Image", new DockerImageAssetProps {
Directory = "./docker-image"
})
}
}) }
});
Synopsis
Constructors
LinuxBuildImage(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
LinuxBuildImage(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
Methods
FromAsset(Construct, String, IDockerImageAssetProps) | Uses an Docker image asset as a x86-64 Linux build image. |
FromCodeBuildImageId(String) | Uses a Docker image provided by CodeBuild. |
FromDockerRegistry(String, IDockerImageOptions) | |
FromEcrRepository(IRepository, String) | |
RunScriptBuildspec(String) | Make a buildspec to run the indicated script. |
Validate(IBuildEnvironment) | Allows the image a chance to validate whether the passed configuration is correct. |
Constructors
LinuxBuildImage(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected LinuxBuildImage(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
LinuxBuildImage(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected LinuxBuildImage(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AMAZON_LINUX_2
AMAZON_LINUX_2_2
AMAZON_LINUX_2_3
The Amazon Linux 2 x86_64 standard image, version 3.0
.
public static IBuildImage AMAZON_LINUX_2_3 { get; }
Property Value
AMAZON_LINUX_2_ARM
public static IBuildImage AMAZON_LINUX_2_ARM { get; }
Property Value
Remarks
Stability: Deprecated
AMAZON_LINUX_2_ARM_2
(deprecated) Image "aws/codebuild/amazonlinux2-aarch64-standard:2.0".
public static IBuildImage AMAZON_LINUX_2_ARM_2 { get; }
Property Value
Remarks
Stability: Deprecated
DefaultComputeType
The default {@link ComputeType} to use with this image, if one was not specified in {@link BuildEnvironment#computeType} explicitly.
public virtual ComputeType DefaultComputeType { get; }
Property Value
ImageId
The Docker image identifier that the build environment uses.
public virtual string ImageId { get; }
Property Value
System.String
ImagePullPrincipalType
The type of principal that CodeBuild will use to pull this build Docker image.
public virtual Nullable<ImagePullPrincipalType> ImagePullPrincipalType { get; }
Property Value
System.Nullable<ImagePullPrincipalType>
Repository
An optional ECR repository that the image is hosted in.
public virtual IRepository Repository { get; }
Property Value
SecretsManagerCredentials
The secretsManagerCredentials for access to a private registry.
public virtual ISecret SecretsManagerCredentials { get; }
Property Value
STANDARD_1_0
STANDARD_2_0
STANDARD_3_0
STANDARD_4_0
The aws/codebuild/standard:4.0
build image.
public static IBuildImage STANDARD_4_0 { get; }
Property Value
STANDARD_5_0
The aws/codebuild/standard:5.0
build image.
public static IBuildImage STANDARD_5_0 { get; }
Property Value
Type
The type of build environment.
public virtual string Type { get; }
Property Value
System.String
UBUNTU_14_04_ANDROID_JAVA8_24_4_1
public static IBuildImage UBUNTU_14_04_ANDROID_JAVA8_24_4_1 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_ANDROID_JAVA8_26_1_1
public static IBuildImage UBUNTU_14_04_ANDROID_JAVA8_26_1_1 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_BASE
public static IBuildImage UBUNTU_14_04_BASE { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_DOCKER_17_09_0
public static IBuildImage UBUNTU_14_04_DOCKER_17_09_0 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_DOCKER_18_09_0
public static IBuildImage UBUNTU_14_04_DOCKER_18_09_0 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_DOTNET_CORE_1_1
public static IBuildImage UBUNTU_14_04_DOTNET_CORE_1_1 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_DOTNET_CORE_2_0
public static IBuildImage UBUNTU_14_04_DOTNET_CORE_2_0 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_DOTNET_CORE_2_1
public static IBuildImage UBUNTU_14_04_DOTNET_CORE_2_1 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_GOLANG_1_10
public static IBuildImage UBUNTU_14_04_GOLANG_1_10 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_GOLANG_1_11
public static IBuildImage UBUNTU_14_04_GOLANG_1_11 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_NODEJS_10_1_0
public static IBuildImage UBUNTU_14_04_NODEJS_10_1_0 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_NODEJS_10_14_1
public static IBuildImage UBUNTU_14_04_NODEJS_10_14_1 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_NODEJS_6_3_1
public static IBuildImage UBUNTU_14_04_NODEJS_6_3_1 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_NODEJS_8_11_0
public static IBuildImage UBUNTU_14_04_NODEJS_8_11_0 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_OPEN_JDK_11
public static IBuildImage UBUNTU_14_04_OPEN_JDK_11 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_OPEN_JDK_8
public static IBuildImage UBUNTU_14_04_OPEN_JDK_8 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_OPEN_JDK_9
public static IBuildImage UBUNTU_14_04_OPEN_JDK_9 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_PHP_5_6
public static IBuildImage UBUNTU_14_04_PHP_5_6 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_PHP_7_0
public static IBuildImage UBUNTU_14_04_PHP_7_0 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_PHP_7_1
public static IBuildImage UBUNTU_14_04_PHP_7_1 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_PYTHON_2_7_12
public static IBuildImage UBUNTU_14_04_PYTHON_2_7_12 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_PYTHON_3_3_6
public static IBuildImage UBUNTU_14_04_PYTHON_3_3_6 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_PYTHON_3_4_5
public static IBuildImage UBUNTU_14_04_PYTHON_3_4_5 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_PYTHON_3_5_2
public static IBuildImage UBUNTU_14_04_PYTHON_3_5_2 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_PYTHON_3_6_5
public static IBuildImage UBUNTU_14_04_PYTHON_3_6_5 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_PYTHON_3_7_1
public static IBuildImage UBUNTU_14_04_PYTHON_3_7_1 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_RUBY_2_2_5
public static IBuildImage UBUNTU_14_04_RUBY_2_2_5 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_RUBY_2_3_1
public static IBuildImage UBUNTU_14_04_RUBY_2_3_1 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_RUBY_2_5_1
public static IBuildImage UBUNTU_14_04_RUBY_2_5_1 { get; }
Property Value
Remarks
Stability: Deprecated
UBUNTU_14_04_RUBY_2_5_3
public static IBuildImage UBUNTU_14_04_RUBY_2_5_3 { get; }
Property Value
Remarks
Stability: Deprecated
Methods
FromAsset(Construct, String, IDockerImageAssetProps)
Uses an Docker image asset as a x86-64 Linux build image.
public static IBuildImage FromAsset(Construct scope, string id, IDockerImageAssetProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IDockerImageAssetProps
Returns
FromCodeBuildImageId(String)
Uses a Docker image provided by CodeBuild.
public static IBuildImage FromCodeBuildImageId(string id)
Parameters
- id System.String
The image identifier.
Returns
A Docker image provided by CodeBuild.
Remarks
Examples
"aws/codebuild/standard:4.0";
FromDockerRegistry(String, IDockerImageOptions)
public static IBuildImage FromDockerRegistry(string name, IDockerImageOptions options = null)
Parameters
- name System.String
- options IDockerImageOptions
Returns
a x86-64 Linux build image from a Docker Hub image.
FromEcrRepository(IRepository, String)
public static IBuildImage FromEcrRepository(IRepository repository, string tagOrDigest = null)
Parameters
- repository IRepository
The ECR repository.
- tagOrDigest System.String
Image tag or digest (default "latest", digests must start with
sha256:
).
Returns
A x86-64 Linux build image from an ECR repository.
NOTE: if the repository is external (i.e. imported), then we won't be able to add a resource policy statement for it so CodeBuild can pull the image.
Remarks
RunScriptBuildspec(String)
Make a buildspec to run the indicated script.
public virtual BuildSpec RunScriptBuildspec(string entrypoint)
Parameters
- entrypoint System.String
Returns
Validate(IBuildEnvironment)
Allows the image a chance to validate whether the passed configuration is correct.
public virtual string[] Validate(IBuildEnvironment _)
Parameters
Returns
System.String[]