Error deploy dockerfie app dockerfile with CI/CD

Hi,
I’m trying to deploy a Spring boot application to fly.io with CI/CD (using Jetbrains Space Automation).

I have an issue when the fly building worker trying to build the docker image I think. Here is my logs.


I also attach my automation script.

job("Deploy to fly.io") {
    startOn {
        gitPush {
            branchFilter {
                +"refs/heads/develop"
            }
        }
    }
    container(displayName = "Fly.io", image = "alpine/curl:latest") {
        env["FLY_API_TOKEN"] = Secrets("fly_token")
        shellScript {
            content =
                """
                curl -L https://fly.io/install.sh | sh
                /root/.fly/bin/flyctl wireguard websockets enable
                /root/.fly/bin/flyctl agent restart
                /root/.fly/bin/flyctl deploy
                """
        }
    }
}

To let you know, I am able to build the app when I using flyctl on my machine, but it is not working with CI/CD.

I can see two difference from when I build the app on my computer.

There an error on the .dockerignore

Error matching .dockerignore: syntax error in pattern

And

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-mount159759456/Dockerfile: no such file or directory

To finish, I checked if I was in the right directory, the name of the Dockerfile and display the .dockerignore file to see if there were an encoding issue but none of that is wrong for me.

If someone can help me with it, il would be great.

Hey!

I am facing the same issue and I am wondering, were you able to fix the issue?

My error wad due to windows \ syntax because on the docker, it run on linux, so \ was interpreted as escaping.
Just change all \ by / on you’re dockerfile

2 Likes

nah… Unfortunately it isn’t my case
But thank you for your reply!

I found the issue!

It was really caused by “\” syntax. But inside .dockerignore file.

1 Like

You just saved me, I was looking since 3.5 hours.
Thank you so much.
It was inside my .gitignore, that wasn’t created by me.