Github Action for Deployment - Dockerfile not found

Hello,

I posted this a week ago when flyctl was having some problems, but they seem to be resolved now and I’m still getting the same error as before.

I set up a github action to deploy my app to dev/prod environments, just like the docs say (and also a lot of people in this forum), but I get an error saying the Dockerfile (which is in the root of my project) cannot be found.

That’s my github action:

name: Fly Deploy
on:
    push:
        branches:
            - main
            - dev
env:
    FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
    deploy:
        name: Deploy app
        runs-on: ubuntu-latest
        steps:
            -   uses: actions/checkout@v3
            -   uses: superfly/flyctl-actions/setup-flyctl@master
            -   name: deploy to PROD
                if: github.ref == 'refs/heads/master'
                run: |
                    echo "deploying BE to PROD"
                    flyctl deploy -a my-app --remote-only

            -   uses: actions/checkout@v3
            -   uses: superfly/flyctl-actions/setup-flyctl@master
            -   name: deploy to DEV
                if: github.ref == 'refs/heads/dev'
                run: |
                    echo "deploying BE to DEV"
                    flyctl deploy -a my-app-dev --remote-only

The error I’m getting is the following:

Error: failed to fetch an image or build from source: error building: failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /data/docker/tmp/buildkit-mount129862266/Dockerfile: no such file or directory

Any help would be greatly appreciated.

The problem was caused by the slashes in the .dockerignore file, because I’m using Windows locally and the builder is using Linux… had to change all backward slashes to forward ones.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.