title: Docker compose won't push to ECR
body: <p>I'm trying to set up deployment where on <code>docker compose up</code> command it would build necessary images, push them to ECR and launch everything on ECS.</p>
  <p>What I've done so far.</p>
  <ol>
  <li>Created and switched to aws context:</li>
  </ol>
  <pre><code>docker context create ecs aws
  docker context use aws
  </code></pre>
  <ol start="2">
  <li>Created <code>docker-compose.yml</code> file:</li>
  </ol>
  <pre><code>version: '3.9'
  services:
    frontend:
      build: ./frontend
      image: &lt;my_aws_id&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com/frontend:latest
    backend:
      build: ./backend
      image: &lt;my_aws_id&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com/backend:latest
    nginx:
      build: ./nginx
      image: &lt;my_aws_id&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com/nginx:latest
      ports:
        - 80:80
  </code></pre>
  <p>After reading a bunch of manuals, to my understanding, command <code>docker compose up</code> should:</p>
  <ol>
  <li>Build images</li>
  <li>Push them to ECR</li>
  <li>Create cluster and necessary tasks on ECS</li>
  <li>Launch containers</li>
  </ol>
  <p>Instead I'm having error that telling me that those images are not found. Yes, my ECR repo is empty, but I expect <code>docker compose up</code> to build and push images to that repo, not just try to get them from ECR.</p>
  <p>What am I doing wrong?</p>