{ "$schema": "https://json-structure.org/meta/core/v0/#", "$id": "https://raw.githubusercontent.com/api-evangelist/amazon-codebuild/refs/heads/main/json-structure/amazon-codebuild-project-environment-structure.json", "name": "ProjectEnvironment", "description": "Information about the build environment of the build project.", "type": "object", "properties": { "type": { "allOf": [ { "$ref": "#/components/schemas/EnvironmentType" }, { "description": "

The type of build environment to use for related builds.

For more information, see Build environment compute types in the CodeBuild user guide.

" } ] }, "image": { "allOf": [ { "$ref": "#/components/schemas/NonEmptyString" }, { "description": "

The image tag or image digest that identifies the Docker image to use for this build project. Use the following formats:

For more information, see Docker images provided by CodeBuild in the CodeBuild user guide.

" } ] }, "computeType": { "allOf": [ { "$ref": "#/components/schemas/ComputeType" }, { "description": "

Information about the compute resources the build project uses. Available values include:

If you use BUILD_GENERAL1_LARGE:

For more information, see Build Environment Compute Types in the CodeBuild User Guide.

" } ] }, "environmentVariables": { "allOf": [ { "$ref": "#/components/schemas/EnvironmentVariables" }, { "description": "A set of environment variables to make available to builds for this build project." } ] }, "privilegedMode": { "allOf": [ { "$ref": "#/components/schemas/WrapperBoolean" }, { "description": "

Enables running the Docker daemon inside a Docker container. Set to true only if the build project is used to build Docker images. Otherwise, a build that attempts to interact with the Docker daemon fails. The default setting is false.

You can initialize the Docker daemon during the install phase of your build by adding one of the following sets of commands to the install phase of your buildspec file:

If the operating system's base image is Ubuntu Linux:

- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay&

- timeout 15 sh -c \"until docker info; do echo .; sleep 1; done\"

If the operating system's base image is Alpine Linux and the previous command does not work, add the -t argument to timeout:

- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay&

- timeout -t 15 sh -c \"until docker info; do echo .; sleep 1; done\"

" } ] }, "certificate": { "allOf": [ { "$ref": "#/components/schemas/String" }, { "description": "The ARN of the Amazon S3 bucket, path prefix, and object key that contains the PEM-encoded certificate for the build project. For more information, see certificate in the CodeBuild User Guide." } ] }, "registryCredential": { "allOf": [ { "$ref": "#/components/schemas/RegistryCredential" }, { "description": " The credentials for access to a private registry." } ] }, "imagePullCredentialsType": { "allOf": [ { "$ref": "#/components/schemas/ImagePullCredentialsType" }, { "description": "

The type of credentials CodeBuild uses to pull images in your build. There are two valid values:

When you use a cross-account or private registry image, you must use SERVICE_ROLE credentials. When you use an CodeBuild curated image, you must use CODEBUILD credentials.

" } ] } }, "required": [ "type", "image", "computeType" ] }