Skip to content

Commit ea138f7

Browse files
committed
update Local Build instructions
1 parent 1e7c142 commit ea138f7

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

local_builds/README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,28 @@ Start by pulling the signed local agent image from [DockerHub](https://hub.docke
1111

1212
docker pull amazon/aws-codebuild-local:latest --disable-content-trust=false
1313

14-
You will run a docker run command and set three environment variables:
1514

15+
You can verify the SHA matches our [latest release](https://docs.aws.amazon.com/codebuild/latest/userguide/samples.html). Please allow at least an hour after a new version has been pushed for the updated SHA to be reflected in our documentation.
16+
17+
You will run a docker run command and set three environment variables. Please note the fourth variable is optional:
1618
1. IMAGE_NAME: your curated environment image
17-
2. SOURCE: your local source directory
18-
3. ARTIFACTS: an artifact output directory
19+
2. SOURCE: the absolute path of your local source directory
20+
3. ARTIFACTS: the absolute path of an artifact output directory
21+
4. BUILDSPEC: The path to your buildspec in your source directory
1922

2023
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.
2124

2225
Command:
2326

24-
docker run -it -v /var/run/docker.sock/var/run/docker.sock -e "IMAGE_NAME=<Build image>" -e "ARTIFACTS=<Absolute path to your artifact output folder>" -e "SOURCE=<Absolute path to your source directory>" amazon/aws-codebuild-local
27+
docker run -it -v /var/run/docker.sock/var/run/docker.sock -e "IMAGE_NAME=<Build image>" -e "ARTIFACTS=<Absolute path to your artifact output folder>" -e "SOURCE=<Absolute path to your source directory>" -e "BUILDSPEC=<Relative path to your buildspec override> amazon/aws-codebuild-local
28+
29+
For example on a Linux machine:
30+
31+
docker run -it -v /var/run/docker.sock:/var/run/docker.sock -e "IMAGE_NAME=awscodebuild/java:openjdk-8" -e "ARTIFACTS=/home/user/testProjectArtifacts" -e "SOURCE=/home/user/testProject" -e "BUILDSPEC=test.yml" amazon/aws-codebuild-local
32+
33+
34+
Note: If running on a different operating system, your **absolute path** may vary:
2535

26-
For example:
36+
Linux: /home/user/...
37+
MacOS: /Users/user/...
2738

28-
docker run -it -v /var/run/docker.sock:/var/run/docker.sock -e "IMAGE_NAME=awscodebuild/java:openjdk-8" -e "ARTIFACTS=/home/user/testProjectArtifacts" -e "SOURCE=/home/user/testProject" amazon/aws-codebuild-local

0 commit comments

Comments
 (0)