diff --git a/provider/register-aws/build-aws/Dockerfile b/provider/register-aws/build-aws/Dockerfile index e07b6ef063ce9582ef288d8894193e6aa68a2246..b6264f35ea8b1022a641ec2366b31ecdaecf07d2 100644 --- a/provider/register-aws/build-aws/Dockerfile +++ b/provider/register-aws/build-aws/Dockerfile @@ -13,18 +13,21 @@ # limitations under the License. # https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html -FROM public.ecr.aws/amazoncorretto/amazoncorretto:17 +FROM registry.repo.osdu.aws/amazoncorretto:17-alpine -RUN yum update -y && yum install -y shadow-utils \ - && groupadd -g 10001 -r appgroup \ - && useradd -M -g 10001 -r -u 10001 appuser +RUN apk update && \ + apk add --no-cache \ + bash \ + curl \ + shadow \ + && \ + /usr/sbin/groupadd -g 10001 -r appgroup && \ + /usr/sbin/useradd -M -g 10001 -r -u 10001 appuser ARG JAR_FILE=provider/register-aws/target/*spring-boot.jar # Harcoding this value since Register-core requires this variable. AWS does not use it. Might change in future ENV ENVIRONMENT=DEV - - WORKDIR / COPY ${JAR_FILE} app.jar COPY /provider/register-aws/build-aws/entrypoint.sh /entrypoint.sh diff --git a/provider/register-aws/build-aws/buildspec.yaml b/provider/register-aws/build-aws/buildspec.yaml index 691fd21bc2f6608295299d45b1ec2bf874d6105b..d7390c46ffdf5835960125fa58d9a11c0eba0770 100644 --- a/provider/register-aws/build-aws/buildspec.yaml +++ b/provider/register-aws/build-aws/buildspec.yaml @@ -77,12 +77,10 @@ phases: - echo "--Copying Helm Charts to ${OUTPUT_DIR:-dist}--" - rsync -r devops/aws/* "${OUTPUT_DIR:-dist}" - - echo "Building docker image..." - - docker build -f provider/register-aws/build-aws/Dockerfile -t ${ECR_IMAGE} . - - docker tag ${ECR_IMAGE} ${ECR_IMAGE_BRANCH_LATEST} - - echo "Pushing docker image..." - - docker push ${ECR_IMAGE} - - docker push ${ECR_IMAGE_BRANCH_LATEST} + - echo "Build and push docker image..." + - docker buildx create --driver docker-container --use + - docker buildx inspect --bootstrap + - docker buildx build --platform linux/arm64/v8,linux/amd64 --pull --push -f provider/register-aws/build-aws/Dockerfile -t ${ECR_IMAGE} -t ${ECR_IMAGE_BRANCH_LATEST} . - echo "Generate build-info.json" - |