File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33# ECR and base image configuration - extracted from CodeBuild environment
44ARG ECR_ACCOUNT_ID=0123456789012
55ARG ECR_REGION=us-east-1
6- ARG BASE_IMAGE_NAME=civis -ubuntu-fips
6+ ARG BASE_IMAGE_NAME=docker-linuxserver -ubuntu-fips
77ARG BASE_IMAGE_TAG=22.04
88ARG ECR_URI=${ECR_ACCOUNT_ID}.dkr.ecr-fips.${ECR_REGION}.amazonaws.com/${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG}
99
Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ phases:
33 pre_build :
44 commands :
55 - export DOCKER_BUILDKIT=1
6- - echo Logging in to Amazon ECR...
7- - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI}
86 - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)"
97 - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)"
108 build :
119 commands :
10+ - echo Logging in to Amazon ECR...
11+ - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI}
1212 - echo Building the Docker image...
1313 - docker build --build-arg ECR_ACCOUNT_ID=${ECR_ACCOUNT_ID} --build-arg ECR_REGION=${ECR_REGION} -t ${FIPS_REPOSITORY_URI}:latest .
1414 - docker image push --all-tags ${FIPS_REPOSITORY_URI}
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ phases:
33 pre_build :
44 commands :
55 - export DOCKER_BUILDKIT=1
6+ - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)"
7+ - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)"
68 build :
79 commands :
810 - echo Logging in to Amazon ECR...
911 - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI}
1012 - export COMMIT_HASH_SHORT="$(echo $COMMIT_HASH | cut -c 1-7)"
11- - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)"
12- - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)"
1313 - echo Building the Docker image...
1414 - echo $COMMIT_HASH_SHORT
1515 - echo $BRANCH_NAME
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ phases:
44 pre_build :
55 commands :
66 - export DOCKER_BUILDKIT=1
7+ - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)"
8+ - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)"
79 build :
810 commands :
911 - echo Logging in to Amazon ECR...
1012 - aws ecr get-login-password --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${FIPS_REPOSITORY_URI}
11- - export ECR_ACCOUNT_ID="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f1)"
12- - export ECR_REGION="$(echo $FIPS_REPOSITORY_URI | cut -d'.' -f4)"
1313 - PATCH_TAG=${TAG_NAME#"v"}
1414 - MINOR_TAG=${PATCH_TAG%.*}
1515 - MAJOR_TAG=${MINOR_TAG%.*}
You can’t perform that action at this time.
0 commit comments