Search⌘ K
AI Features

Demo: Building and Validating Changes in Our Local Environment

Explore how to build and validate code changes in a local environment using AWS CodeBuild and Docker. Learn to download and run the CodeBuild Docker image, use build scripts, and compile sample projects locally to ensure changes work before pushing to AWS. This lesson helps developers gain confidence in their builds while preparing for automated CI/CD pipelines.

Developers might wish to test their modifications on their local device before allowing AWS CodeBuild to compile the source code and produce output artifacts.

Locally utilizing CodeBuild

AWS CodeBuild allows recreating the same environment in the developer’s local machine so that they can validate the changes before submitting them to AWS. The first step is downloading the Docker image from the GitHub repository, as shown below.

Downloading the AWS CodeBuild Docker image

Once the package is downloaded, it creates a new directory, aws-codebuild-docker-images. The image comes prepackaged with three versions of the image, and we chose to install the most recent one.

Diff
root@educative:/# git clone https://github.com/aws/aws-codebuild-docker-images.git
Cloning into 'aws-codebuild-docker-images'...
remote: Enumerating objects: 2567, done.
remote: Counting objects: 100% (466/466), done.
remote: Compressing objects: 100% (235/235), done.
remote: Total 2567 (delta 246), reused 361 (delta 166), pack-reused 2101
Receiving objects: 100% (2567/2567), 642.59 KiB | 6.69 MiB/s, done.
Resolving deltas: 100% (1203/1203), done.
root@educative:/#

Building the

...