# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 version: 0.2 phases: pre_build: commands: - echo Logging in to Amazon ECR... - aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com build: commands: - echo Build started on `date` - echo Building the download Docker image - docker build -t $DOWNLOAD_IMAGE_REPO_NAME:$DOWNLOAD_IMAGE_TAG docker/download - docker tag $DOWNLOAD_IMAGE_REPO_NAME:$DOWNLOAD_IMAGE_TAG $ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$DOWNLOAD_IMAGE_REPO_NAME:$DOWNLOAD_IMAGE_TAG post_build: commands: - echo Build completed on `date` - echo Pushing the download Docker image - docker push $ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$DOWNLOAD_IMAGE_REPO_NAME:$DOWNLOAD_IMAGE_TAG