Skip to content

Commit a07b8a3

Browse files
committed
Update local builds documentation and script now that the local agent images are published in public ECR
1 parent 206fa37 commit a07b8a3

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

local_builds/README.md

+22-24
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,35 @@ CodeBuild. Now, you can simulate a CodeBuild environment locally to quickly trou
77
commands and settings located in the BuildSpec file. The agent also allows you to build your application
88
locally before committing your changes to build on the cloud.
99

10-
Start by pulling the signed local agent image from [DockerHub](https://hub.docker.com/r/amazon/aws-codebuild-local/):
10+
Start by pulling the signed local agent image from [public ECR](https://gallery.ecr.aws/codebuild/local-builds):
1111

12-
For x86_64:
13-
docker pull amazon/aws-codebuild-local:latest --disable-content-trust=false
12+
For x86_64: `docker pull public.ecr.aws/codebuild/local-builds:latest`
1413

15-
For ARM:
16-
docker pull amazon/aws-codebuild-local:aarch64 --disable-content-trust=false
14+
For ARM: `docker pull public.ecr.aws/codebuild/local-builds:aarch64`
1715

18-
You can verify the SHA matches our [latest release](https://docs.aws.amazon.com/codebuild/latest/userguide/use-codebuild-agent.html#codebuild-agent-sha). Please allow at least an hour after a new version has been pushed for the updated SHA to be reflected in our documentation.
16+
You can verify the SHA matches our [latest release](https://docs.aws.amazon.com/codebuild/latest/userguide/use-codebuild-agent.html#codebuild-agent-sha). Please allow at least an hour after a new version has been pushed for the updated SHA to be reflected in our documentation.
1917

2018
Download and use our codebuild_build.sh script to run your local builds.
2119

2220
usage: codebuild_build.sh [-i image_name] [-a artifact_output_directory] [options]
2321

24-
**Required:**
25-
-i Used to specify the customer build container image.
26-
-a Used to specify an artifact output directory.
27-
28-
**Optional:**
29-
-l Used to override the default local agent image. Default is "amazon/aws-codebuild-local:latest".
30-
-r Used to specify a report output directory.
31-
-c Use the AWS configuration and credentials from your local host. This includes ~/.aws and any AWS_* environment variables.
32-
-p Used to specify the AWS CLI Profile.
33-
-b Used to specify a buildspec override file. Defaults to buildspec.yml in the source directory.
34-
-e Used to specify a file containing environment variables.
35-
-m Used to mount the source directory to the customer build container directly.
36-
-d Used to run the build container in docker privileged mode.
37-
-s Used to specify a source directory. Defaults to the current working directory.
38-
* First (-s) is for primary source
39-
* Use additional (-s) in `<sourceIdentifier>:<sourceLocation>` format for secondary source
40-
* For `sourceIdentifier`, use a value that is fewer than 128 characters and contains only alphanumeric characters and underscores
22+
**Required:**
23+
* `-i` Used to specify the customer build container image.
24+
* `-a` Used to specify an artifact output directory.
25+
26+
**Optional:**
27+
* `-l` Used to override the default local agent image. Default is "public.ecr.aws/codebuild/local-builds:latest"
28+
* `-r` Used to specify a report output directory.
29+
* `-c` Use the AWS configuration and credentials from your local host. This includes ~/.aws and any AWS_* environment variables.
30+
* `-p` Used to specify the AWS CLI Profile.
31+
* `-b` Used to specify a buildspec override file. Defaults to buildspec.yml in the source directory.
32+
* `-e` Used to specify a file containing environment variables.
33+
* `-m` Used to mount the source directory to the customer build container directly.
34+
* `-d` Used to run the build container in docker privileged mode.
35+
* `-s` Used to specify a source directory. Defaults to the current working directory.
36+
* First `-s` is for primary source
37+
* Use additional `-s` in `<sourceIdentifier>:<sourceLocation>` format for secondary source
38+
* For `sourceIdentifier`, use a value that is fewer than 128 characters and contains only alphanumeric characters and underscores
4139

4240
**Environment variable file format:**
4341
* Expects each line to be in VAR=VAL format
@@ -46,4 +44,4 @@ Download and use our codebuild_build.sh script to run your local builds.
4644
* File can be of type .env or .txt
4745
* There is no special handling of quotation marks, meaning they will be part of the VAL
4846

49-
Note that if you want to use an AWS CodeBuild Curated image, you can build it locally on your machine by cloning this repository and performing a docker build on your choice of image.
47+
Note that if you want to use an AWS CodeBuild Amazon Linux 2 curated image, you can pull it from [public ECR](https://gallery.ecr.aws/codebuild/amazonlinux2-x86_64-standard). If you want to use an Ubuntu-based curated image, you can build it locally on your machine by cloning this repository and performing a docker build on your choice of image.

local_builds/codebuild_build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ if [ -n "$local_agent_image" ]
186186
then
187187
docker_command+=" $local_agent_image"
188188
else
189-
docker_command+=" amazon/aws-codebuild-local:latest"
189+
docker_command+=" public.ecr.aws/codebuild/local-builds:latest"
190190
fi
191191

192192
# Note we do not expose the AWS_SECRET_ACCESS_KEY or the AWS_SESSION_TOKEN

0 commit comments

Comments
 (0)