Question 58:
As a DevOps engineer, you create an AWS CodePipeline to build a Docker image and deploy the application to AWS ECS. The build stage is implemented using AWS CodeBuild where the Docker image is built and tagged. In the CodeBuild post_build phase, the Docker image is pushed to the ECR repository. You create the buildspec.yml file as follows:
Answer options:
A.The docker image with $IMAGE_TAG should be pushed in the post_build phase. B.CodeBuild can automatically log in to ECR if the IAM role has the ECR read access. There is no need to execute “aws ecr get-login-password”. C.The docker push command should be put in the build stage as the post_build stage is only used for resource cleanup. D.“aws ecr get-login-password” only retrieves a token to log in to ECR. You need to execute the printed command to log in to the registry with Docker. E.Before docker push, you also need to do “aws ecr get-login-password” in the post_build stage.