Build the harness image
Progress checklist
Overview
Section titled “Overview”One arm64 Docker image, built by CodeBuild and pushed to ECR. EC2 pulls it later — it never
docker builds on the box. This stack outlives a single lab run (demo.sh down leaves it), so
finish with ./scripts/image.sh down when you are done — see Tear down.
| Resource | Name |
|---|---|
| ECR repository | s3x-hotlookup-harness |
| CodeBuild project | s3x-hotlookup-harness |
| CodeBuild role | s3x-hotlookup-codebuild |
| Source bucket | s3x-hotlookup-cb-${ACCOUNT_ID} |
| State file | .image-state.json (gitignored) |
-
Export the lab profile and Region, then create the durable pipeline (idempotent if it already exists).
Terminal window export AWS_PROFILE=sandboxexport AWS_REGION=ap-southeast-2export S3X_LAB_ALLOW_AWS=1./scripts/image.sh upThe wrapper echoes each AWS call. It creates the ECR repository, source bucket, IAM role, and CodeBuild project (
ARM_CONTAINER, imageaws/codebuild/amazonlinux-aarch64-standard:3.0), then writes.image-state.json.Looks like (verified in
ap-southeast-2):Image pipeline is ready.ECR repository s3x-hotlookup-harnessECR URI 123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/s3x-hotlookup-harnessCodeBuild s3x-hotlookup-harnessSource bucket s3://s3x-hotlookup-cb-123456789012Service role arn:aws:iam::123456789012:role/s3x-hotlookup-codebuild -
Build and push the image. CodeBuild zips
harness/, uploads it to the source bucket, starts a build, and waits until status isSUCCEEDED. Default tag is the git short SHA (or a timestamp if git is unavailable);:latestis always pushed too.Terminal window ./scripts/image.sh build# optional override:# IMAGE_TAG=$(git rev-parse --short HEAD) ./scripts/image.sh buildLooks like (verified in
ap-southeast-2; tag is your git short SHA):Started build s3x-hotlookup-harness:… (tag=c3cad1d)buildStatus=IN_PROGRESS…buildStatus=SUCCEEDEDBuild succeeded.Image 123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/s3x-hotlookup-harness:c3cad1dAlso 123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/s3x-hotlookup-harness:latest
Verify
Section titled “Verify”./scripts/image.sh statusLooks like (verified in ap-southeast-2):
ecr=s3x-hotlookup-harnessuri=123456789012.dkr.ecr.ap-southeast-2.amazonaws.com/s3x-hotlookup-harnesstag=c3cad1dPlus a short table of recent image tags from ECR (for example c3cad1d,latest). On failure, check
CloudWatch Logs for /aws/codebuild/s3x-hotlookup-harness.
Continue to Create the VPC.