CmdID

CmdID / Commands

aws-ecr

Push, pull, and manage container images. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Authenticate Docker with the default registry (username is AWS)

aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.comIdentify
--regionThe region to use. AWS CLI reference

Create a repository

aws ecr create-repository --repository-name repository --image-scanning-configuration scanOnPush=true --region regionIdentify
--repository-nameThe name to use for the repository. AWS CLI reference
--image-scanning-configurationThe imageScanningConfiguration parameter is being deprecated, in favor of specifying the image scanning configuration at the registry level. AWS CLI reference
--regionThe region to use. AWS CLI reference

Tag a local image for ECR

docker tag container_name:tag aws_account_id.dkr.ecr.region.amazonaws.com/container_name:tagIdentify

Push an image to a repository

docker push aws_account_id.dkr.ecr.region.amazonaws.com/container_name:tagIdentify

Pull an image from a repository

docker pull aws_account_id.dkr.ecr.region.amazonaws.com/container_name:tagIdentify

Delete an image from a repository

aws ecr batch-delete-image --repository-name repository --image-ids imageTag=latestIdentify
--repository-nameThe repository that contains the image to delete. AWS CLI reference
--image-idsA list of image ID references that correspond to images to delete. AWS CLI reference

Delete a repository

aws ecr delete-repository --repository-name repository --forceIdentify
--repository-nameThe name of the repository to delete. AWS CLI reference
--forceIf true, deleting the repository force deletes the contents of the repository. AWS CLI reference

List images within a repository

aws ecr list-images --repository-name repositoryIdentify
--repository-nameThe repository with image IDs to be listed. AWS CLI reference