title: Dockerfile: Failed to compute cache key: "/tsconfig.json": not found
body: <p>I'm currently trying to set up GitHub actions, to automatically build and push a backend to DockerHub. However, if the workflow <code>build-and-deploy-backend</code> is triggered
  it starts creating the Docker Image but fails at the line <code>23</code> in the <code>server/Dockerfile</code>:</p>
  <pre><code>  22 |     COPY ./src ./src
    23 | &gt;&gt;&gt; COPY ./tsconfig.json ./
  </code></pre>
  <p>See: <a href="https://github.com/bennodev19/dronies-watch/runs/4813916640?check_suite_focus=true" rel="nofollow noreferrer">https://github.com/bennodev19/dronies-watch/runs/4813916640?check_suite_focus=true</a></p>
  <p>with this Error:</p>
  <pre><code>Dockerfile:23
  --------------------
    21 |     # Move required app source into the working directory referenced with './'
    22 |     COPY ./src ./src
    23 | &gt;&gt;&gt; COPY ./tsconfig.json ./
    24 |     
    25 |     # For debugging:
  --------------------
  error: failed to solve: failed to compute cache key: &quot;/tsconfig.json&quot;: not found
  Error: buildx failed with: error: failed to solve: failed to compute cache key: &quot;/tsconfig.json&quot;: not found
  </code></pre>
  <p>See: <a href="https://github.com/bennodev19/dronies-watch/runs/4813916640?check_suite_focus=true" rel="nofollow noreferrer">https://github.com/bennodev19/dronies-watch/runs/4813916640?check_suite_focus=true</a></p>
  <p>Locally it builds without any problem. Tested on <code>MacOS</code> and <code>Windows 10</code>.</p>
  <p><code>build-and-deploy-backend</code></p>
  <pre class="lang-yaml prettyprint-override"><code># *
  
  jobs:
    build-and-deploy-backend:
      name:  Build Backend Image for Prod &amp; Push to Dockerhub
      runs-on: ubuntu-latest
      steps:
        - name:  Checkout
          uses: actions/checkout@v2
  
        - name:  Set up Docker Buildx
          id: buildx
          uses: docker/setup-buildx-action@v1
  
        - name:  Login to DockerHub
          uses: docker/login-action@v1
          with:
            username: ${{ secrets.DOCKER_USERNAME }}
            password: ${{ secrets.DOCKER_PASSWORD }}
  
        - name:  Build and push Docker Image to DockerHub
           id: docker_build
           uses: docker/build-push-action@v2
           with:
            context: .
            file: server/Dockerfile # Path to the Dockerfile from which to build the Docker Image from (default {context}/Dockerfile)
            builder: ${{ steps.buildx.outputs.name }}
            push: true
            tags: latest
  
        - name: Image digest
          run: echo ${{ steps.docker_build.outputs.digest }}
  </code></pre>
  <p>See full file: <a href="https://github.com/bennodev19/dronies-watch/blob/master/.github/workflows/release.yaml" rel="nofollow noreferrer">https://github.com/bennodev19/dronies-watch/blob/master/.github/workflows/release.yaml</a></p>
  <p><code>server/Dockerfile</code></p>
  <pre><code>FROM node:lts-alpine
  
  RUN mkdir -p /app
  WORKDIR /app
  
  COPY package.json ./
  COPY yarn.lock ./
  RUN yarn install
  
  COPY src ./src
  COPY tsconfig.json ./
  
  RUN yarn build
  
  CMD [ &quot;yarn&quot;, &quot;start&quot; ]
  
  EXPOSE 5000
  </code></pre>
  <p>See full file: <a href="https://github.com/bennodev19/dronies-watch/blob/master/server/Dockerfile" rel="nofollow noreferrer">https://github.com/bennodev19/dronies-watch/blob/master/server/Dockerfile</a></p>
  <h4>Other</h4>
  <ul>
  <li>Repository URL:  <a href="https://github.com/bennodev19/dronies-watch" rel="nofollow noreferrer">https://github.com/bennodev19/dronies-watch</a></li>
  </ul>