Cannot use different Dockerfile in fly.toml configuration

So here I am, minding my own business to launch my app to Fly.io. I use this TOML configuration to deploy my app:

# fly.toml file generated for monika on 2022-01-25T16:13:36+07:00

app = "app"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
dockerfile = "Dockerfile.flyio"

[build.args]
KEY = "<REDACTED>"
URL = "<REDACTED>"

[env]
KEY = "<REDACTED>"
URL = "<REDACTED>"

[experimental]
auto_rollback = true

Because I have two Dockerfile: Dockerfile and Dockerfile.flyio. When I deploy using flyctl launch it says:

❯ flyctl launch                      
An existing fly.toml file was found for app app
App is not running, deploy...
Deploying app
==> Validating app configuration
--> Validating app configuration done
Remote builder fly-builder-young-pine-9696 ready
==> Creating build context
Error Rel: can't make Dockerfile relative to /home/user/Projects/app

Even though the Dockerfile.flyio is present, it won’t work. Am I doing it wrong?

Surprisingly, it works with flyctl launch --dockerfile Dockerfile.flyio

But it didn’t work with Dockerfile in TOML configuration as told here App Configuration (fly.toml)

Updated: After deleting the existing app, and rerun using the initial config, it works now.

Maybe it’s something you guys need to check :grinning:

1 Like

fly launch isn’t what you want when you have an existing fly.toml. fly deploy is! Is that what you’re using now?

Yeah, took me a while to figure it out. All is well now :smiley:

1 Like