2

I'm trying to push a docker image to aws by using Invoke-Expression -Command (Get-ECRLoginCommand -Region us-east-2).Command

but i Just want to know the correct format of this command to push the image

Yashika
  • 21
  • 2

1 Answers1

2

From your question, it seems you want to push or pull the image from ECR. Here are the steps

  1. configure first aws configure using aws-cli or assign role if you are on the remote server
  2. then open the aws console of ECR if you are in us-west-2 or change the region repositories region us-west-2
  3. click on your repository and the select view push command enter image description here

Here is the command for window

Invoke-Expression -Command (Get-ECRLoginCommand -Region us-west-2).Command

The command for Linux/Mac

$(aws ecr get-login --no-include-email --region us-west-2)
Adiii
  • 44,267
  • 6
  • 120
  • 114
  • yes i'm using windows command for pushing an image but it says that the Invoke-Expression command is not found – Yashika Jul 25 '19 at 05:22
  • so its related to this https://stackoverflow.com/questions/21095493/invoke-expression-command-not-finding-file-even-though-it-exists – Adiii Jul 25 '19 at 05:28