title: Build docker image locally in GitHub Actions using docker/build-push-action
body: <p>I have several Dockerfiles in my project. One is for building <code>basic</code> image, which contains some business-level abstractions. Others are building services, based on the <code>basic</code> image.</p>
  <p>So in my services' Dockerfiles I have something like</p>
  <pre><code>FROM my-project/base
  # Adding some custom logic around basic stuff
  </code></pre>
  <p>I am using GitHub Actions as my CI/CD tool.
  At first I had a step to install docker into my workers, and then ran something like:</p>
  <pre><code>- name: Build base image
    working-directory: business
    run: docker build -t my-project/base .
  
  - name: Build and push service
    working-directory: service
    run: |
      docker build -t my-ecr-repo/service .
      docker push my-ecr-repo/service
  </code></pre>
  <p>But then I've found docker/build-push-action and decided to use it in my pipeline:</p>
  <pre><code>- name: Build business-layer container
    uses: docker/build-push-action@v2
    with:
      load: true
      tags: my-project/base
      context: business
      file: business/Dockerfile
  
  - name: Build service
    uses: docker/build-push-action@v2
    with:
      push: true
      tags: my-ecr-repo/service
      context: service
      file: service/Dockerfile
  </code></pre>
  <p>As for now, the second step tries to download <strong>docker.io</strong>/my-project/base, and obviously cannot do it, because I never push base image:</p>
  <pre><code>ERROR: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
  </code></pre>
  <p>The question is:
  <strong>What is the correct way to build an image, so it is accessible by the following building steps locally?</strong></p>
  <p>PS:
  I don't want to push my naked <code>basic</code> image anywhere.</p>