LinuxBuildImage¶
-
class
aws_cdk.aws_codebuild.
LinuxBuildImage
(*args: Any, **kwargs)¶ Bases:
object
A CodeBuild image running Linux.
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:
LinuxBuildImage.fromDockerRegistry(image[, { secretsManagerCredentials }])
LinuxBuildImage.fromEcrRepository(repo[, tag])
LinuxBuildImage.fromAsset(parent, id, props)
Methods
-
run_script_buildspec
(entrypoint)¶ Make a buildspec to run the indicated script.
- Parameters
entrypoint (
str
) –- Return type
-
validate
(*, build_image=None, compute_type=None, environment_variables=None, privileged=None)¶ Allows the image a chance to validate whether the passed configuration is correct.
- Parameters
build_image (
Optional
[IBuildImage
]) – The image used for the builds. Default: LinuxBuildImage.STANDARD_1_0compute_type (
Optional
[ComputeType
]) – The type of compute to use for this build. See the {@link ComputeType} enum for the possible values. Default: taken from {@link #buildImage#defaultComputeType}environment_variables (
Optional
[Mapping
[str
,BuildEnvironmentVariable
]]) – The environment variables that your builds can use.privileged (
Optional
[bool
]) – Indicates how the project builds Docker images. Specify true to enable running the Docker daemon inside a Docker container. This value must be set to true only if this build project will be used to build Docker images, and the specified build environment image is not one provided by AWS CodeBuild with Docker support. Otherwise, all associated builds that attempt to interact with the Docker daemon will fail. Default: false
- Return type
List
[str
]
Attributes
-
AMAZON_LINUX_2
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
AMAZON_LINUX_2_2
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
AMAZON_LINUX_2_3
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
AMAZON_LINUX_2_ARM
= <jsii._reference_map.InterfaceDynamicProxy object>¶
-
STANDARD_1_0
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
STANDARD_2_0
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
STANDARD_3_0
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
STANDARD_4_0
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
STANDARD_5_0
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_ANDROID_JAVA8_24_4_1
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_ANDROID_JAVA8_26_1_1
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_BASE
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_DOCKER_17_09_0
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_DOCKER_18_09_0
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_DOTNET_CORE_1_1
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_DOTNET_CORE_2_0
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_DOTNET_CORE_2_1
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_GOLANG_1_10
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_GOLANG_1_11
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_NODEJS_10_14_1
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_NODEJS_10_1_0
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_NODEJS_6_3_1
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_NODEJS_8_11_0
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_OPEN_JDK_11
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_OPEN_JDK_8
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_OPEN_JDK_9
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_PHP_5_6
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_PHP_7_0
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_PHP_7_1
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_PYTHON_2_7_12
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_PYTHON_3_3_6
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_PYTHON_3_4_5
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_PYTHON_3_5_2
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_PYTHON_3_6_5
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_PYTHON_3_7_1
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_RUBY_2_2_5
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_RUBY_2_3_1
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_RUBY_2_5_1
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
UBUNTU_14_04_RUBY_2_5_3
= <aws_cdk.aws_codebuild.LinuxBuildImage object>¶
-
default_compute_type
¶ The default {@link ComputeType} to use with this image, if one was not specified in {@link BuildEnvironment#computeType} explicitly.
- Return type
-
image_id
¶ The Docker image identifier that the build environment uses.
- Return type
str
-
image_pull_principal_type
¶ The type of principal that CodeBuild will use to pull this build Docker image.
- Return type
Optional
[ImagePullPrincipalType
]
-
repository
¶ An optional ECR repository that the image is hosted in.
- Return type
Optional
[IRepository
]
-
secrets_manager_credentials
¶ The secretsManagerCredentials for access to a private registry.
- Return type
Optional
[ISecret
]
-
type
¶ The type of build environment.
- Return type
str
Static Methods
-
classmethod
from_asset
(scope, id, *, directory, build_args=None, file=None, repository_name=None, target=None, extra_hash=None, exclude=None, follow=None, ignore_mode=None)¶ Uses an Docker image asset as a Linux build image.
- Parameters
scope (
Construct
) –id (
str
) –directory (
str
) – (experimental) The directory where the Dockerfile is stored.build_args (
Optional
[Mapping
[str
,str
]]) – (experimental) Build args to pass to thedocker build
command. Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such aslambda.functionArn
orqueue.queueUrl
). Default: - no build args are passedfile (
Optional
[str
]) – (experimental) Path to the Dockerfile (relative to the directory). Default: ‘Dockerfile’repository_name (
Optional
[str
]) – (deprecated) ECR repository name. Specify this property if you need to statically address the image, e.g. from a Kubernetes Pod. Note, this is only the repository name, without the registry and the tag parts. Default: - the default ECR repository for CDK assetstarget (
Optional
[str
]) – (experimental) Docker target to build to. Default: - no targetextra_hash (
Optional
[str
]) – (deprecated) Extra information to encode into the fingerprint (e.g. build instructions and other inputs). Default: - hash is only based on source contentexclude (
Optional
[List
[str
]]) – (deprecated) Glob patterns to exclude from the copy. Default: nothing is excludedfollow (
Optional
[FollowMode
]) – (deprecated) A strategy for how to handle symlinks. Default: Neverignore_mode (
Optional
[IgnoreMode
]) – (deprecated) The ignore behavior to use for exclude patterns. Default: - GLOB for file assets, DOCKER or GLOB for docker assets depending on whether the ‘
- Return type
-
classmethod
from_code_build_image_id
(id)¶ Uses a Docker image provided by CodeBuild.
- Parameters
id (
str
) – The image identifier.- Return type
- Returns
A Docker image provided by CodeBuild.
- See
https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
Example:
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 "aws/codebuild/standard:4.0"
-
classmethod
from_docker_registry
(name, *, secrets_manager_credentials=None)¶ - Parameters
name (
str
) –secrets_manager_credentials (
Optional
[ISecret
]) – The credentials, stored in Secrets Manager, used for accessing the repository holding the image, if the repository is private. Default: no credentials will be used (we assume the repository is public)
- Return type
- Returns
a Linux build image from a Docker Hub image.
-
classmethod
from_ecr_repository
(repository, tag=None)¶ - Parameters
repository (
IRepository
) – The ECR repository.tag (
Optional
[str
]) – Image tag (default “latest”).
- Return type
- Returns
A 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.