
AWS Certified Developer - Associate
Get started today
Ultimate access to all questions.
You are a developer at a technology startup that is actively developing web and mobile applications. To facilitate testing new application versions locally, you need to retrieve Docker images stored in an Amazon Elastic Container Registry (ECR) repository named demo
. This will allow you to run local tests against the latest application version.
Which of the following commands should you execute to pull the existing Docker images from the ECR repository? (Select two)
You are a developer at a technology startup that is actively developing web and mobile applications. To facilitate testing new application versions locally, you need to retrieve Docker images stored in an Amazon Elastic Container Registry (ECR) repository named demo
. This will allow you to run local tests against the latest application version.
Which of the following commands should you execute to pull the existing Docker images from the ECR repository? (Select two)
Explanation:
Overall explanation Correct options:
$(aws ecr get-login --no-include-email)
docker pull 1234567890.dkr.ecr.eu-west-1.amazonaws.com/demo:latest
The get-login command retrieves a token that is valid for a specified registry for 12 hours, and then it prints a docker login command with that authorization token. You can execute the printed command to log in to your registry with Docker, or just run it automatically using the $() command wrapper. After you have logged in to an Amazon ECR registry with this command, you can use the Docker CLI to push and pull images from that registry until the token expires. The docker pull command is used to pull an image from the ECR registry.
Incorrect options:
docker login -u AWS_SECRET_ACCESS_KEY - You cannot login to AWS ECR this way. AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are only used by the CLI and not by docker.
aws docker push 1234567890.dkr.ecr.eu-west-1.amazonaws.com/demo:latest - docker push here is the wrong answer, you need to use docker pull.
docker build -t 1234567890.dkr.ecr.eu-west-1.amazonaws.com/demo:latest - This is a docker command that is used to build Docker images from a Dockerfile.