Question 248:
A DevOps engineer is building a pipeline in AWS CodePipeline to build a docker image and push it to AWS ECR. In the CodePipeline, the source stage is configured with AWS CodeCommit where the source files are stored. In the build stage, the Action Provider is AWS CodeBuild. For its buildspec.yml file, there are three phases which are pre_build, build and post_build. The build stage in the pipeline is responsible for creating the image and pushing it to the ECR repository. Which command should be put in the pre_build stage in the buildspec.yml file?
Answer options:
A.docker build -t $REPOSITORY_URI:latest . B.aws ecr get-login --region $AWS_DEFAULT_REGION C.docker tag $REPOSITORY_URI:latest D.docker push $REPOSITORY_URI:latest