title: Push docker image to amazon ecs repository
body: <p>Im new to AWS. I want to set up a private docker repository on an AWS ECS container instance. I created a repository named <code>name</code>. The example push commands shown by AWS are working.</p>
  
  <pre><code>aws ecr get-login --region us-west-2 
  docker build -t name .
  docker tag name:latest ############.dkr.ecr.us-west-2.amazonaws.com/name:latest 
  docker push ############.dkr.ecr.us-west-2.amazonaws.com/name:latest
  </code></pre>
  
  <p>But with this commands I build and pushed an image named <code>name</code> and I want to build an image named <code>foo</code>. So I altered the commands to:</p>
  
  <pre><code>docker build -t foo .
  docker tag foo ###########.dkr.ecr.us-west-2.amazonaws.com/name/foo
  docker push ###########.dkr.ecr.us-west-2.amazonaws.com/name/foo
  </code></pre>
  
  <p>This should work, but it doesn't. After a period of retrys I get the error:</p>
  
  <pre><code>The push refers to a repository [###########.dkr.ecr.us-west-2.amazonaws.com/name/foo]
  8cc63cf4528f: Retrying in 1 second
  ...
  name unknown: The repository with name 'name/foo' does not exist in the registry with id '############'
  </code></pre>
  
  <p>Does AWS really require a dedicated repository for every image i want to push?</p>