<p>I am trying to build and tag a docker image in Github Actions runner and am getting this error from the runner</p>
<pre class="lang-sh prettyprint-override"><code>unable to prepare context: path &quot; &quot; not found
Error: Process completed with exit code 1.
</code></pre>
<p>I have gone through all other similar issues on StackOverflow and implemented them but still, no way forward.</p>
<p>The interesting thing is, I have other microservices using similar workflow and Dockerfile working perfectly fine.</p>
<p><strong>My workflow</strong></p>
<pre class="lang-yaml prettyprint-override"><code>name: some-tests

on:
  pull_request:
    branches: [ main ]

jobs:
  tests:
    runs-on: ubuntu-latest
    env: 
      AWS_REGION: us-east-1
      IMAGE_NAME: service
      IMAGE_TAG: 1.1.0

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Create cluster
        uses: helm/kind-action@v1.2.0

      - name: Read secrets from AWS Secrets Manager into environment variables
        uses: abhilash1in/aws-secrets-manager-action@v1.1.0
        id: read-secrets
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: ${{ env.AWS_REGION }}
          secrets: |
            users-service/secrets
          parse-json: true

      - name: Build and Tag Image 
        id: build-image
        run: |
          # Build a docker container and Tag
          docker build --file Dockerfile \
          --build-arg APP_API=$USERS_SERVICE_SECRETS_APP_API \
          -t $IMAGE_NAME:$IMAGE_TAG .
          echo &quot;::set-output name=image::$IMAGE_NAME:$IMAGE_TAG&quot;

      - name: Push Image to Kind cluster 
        id: kind-cluster-image-push
        env: 
          KIND_IMAGE: ${{ steps.build-image.outputs.image }}
          CLUSTER_NAME: chart-testing
          CLUSTER_CONTROLLER: chart-testing-control-plane
        run: |
          kind load docker-image $KIND_IMAGE --name $CLUSTER_NAME
          docker exec $CLUSTER_CONTROLLER crictl images

</code></pre>
<p><strong>Dockerfile</strong>*</p>
<pre><code>FROM node:14 AS base
WORKDIR /app

FROM base AS development

COPY .npmrc .npmrc
COPY package.json ./
RUN npm install --production
RUN cp -R node_modules /tmp/node_modules
RUN npm install 
RUN rm -f .npmrc 
COPY . .

FROM development AS builder
COPY .npmrc .npmrc
RUN yarn run build
RUN rm -f .npmrc 
RUN ls -la

FROM node:14-alpine AS production

# Install curl
RUN apk update &amp;&amp; apk add curl

COPY --from=builder /tmp/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package.json ./


ARG APP_API
                        
# set environmental variables

ENV APP_API=$APP_API

EXPOSE ${PORT}

CMD [ &quot;yarn&quot;, &quot;start&quot; ]

</code></pre>
<p>I guess the problem is coming from the building command or something, these are the different things I have tried</p>
<p><strong>I used --file explicitly with period(.)</strong>*</p>
<pre class="lang-yaml prettyprint-override"><code>docker build --file Dockerfile \
          --build-arg APP_API=$USERS_SERVICE_SECRETS_APP_API \
          -t $IMAGE_NAME:$IMAGE_TAG .
          echo &quot;::set-output name=image::$IMAGE_NAME:$IMAGE_TAG&quot;
</code></pre>
<p><strong>I used only period (.)</strong></p>
<pre class="lang-yaml prettyprint-override"><code>docker build \
          --build-arg APP_API=$USERS_SERVICE_SECRETS_APP_API \
          -t $IMAGE_NAME:$IMAGE_TAG .
          echo &quot;::set-output name=image::$IMAGE_NAME:$IMAGE_TAG&quot;
</code></pre>
<p><strong>I used relative path for Dockerfile (./Dockerfile)</strong></p>
<pre class="lang-yaml prettyprint-override"><code>docker build --file ./Dockerfile \
          --build-arg APP_API=$USERS_SERVICE_SECRETS_APP_API \
          -t $IMAGE_NAME:$IMAGE_TAG .
          echo &quot;::set-output name=image::$IMAGE_NAME:$IMAGE_TAG&quot;
</code></pre>
<p><strong>I used relative path for the period (./)</strong></p>
<pre class="lang-yaml prettyprint-override"><code>docker build \
          --build-arg APP_API=$USERS_SERVICE_SECRETS_APP_API \
          -t $IMAGE_NAME:$IMAGE_TAG ./
          echo &quot;::set-output name=image::$IMAGE_NAME:$IMAGE_TAG&quot;
</code></pre>
<p>I have literally exhausted everything I've read from SO</p>

sam hassan
<p>The problem was basically a white-spacing issue. Nothing could show this. Thanks to <a href="https://stackoverflow.com/a/69033092/16069603">This Github answer</a></p>
