Error: open Dockerfile: The system cannot find the file specified.

I’m trying to initialize (not deploy) a new Node app by executing the command fly launch in the root directory of the project (in Windows PowerShell). It asks for a name, region etc, and does indeed create the app, but ultimately fails with this error:

Error: open Dockerfile: The system cannot find the file specified.

The app appears in the list of apps when I use the command fly apps list, however its status is “Pending”, and no fly.toml or Dockerfile have been generated in the project’s directory.

Is fly launch supposed to generate the Dockerfile? I have used fly launch with another Node project some time ago, and there does appear to be a file called Dockerfile in that project’s root directory, so I assume that fly launch generated it back then.

Why isn’t it generating it now? Or what else could be causing this error?

Hey @jslind what flyctl version are using?

fly.exe v0.1.24 windows/amd64 Commit: 86409d36fda482b419410a4af3113d12537a06d7 BuildDate: 2023-06-01T11:52:45Z

Hmm, that’s a bug, fly launch should generate a Dockerfile and a fly.toml file. Have you tried updating flyctl and trying fly launch again?

Indeed. I’ve been making changes in this area recently (for example there was a bug involving usage of pnpm), so having a matching and up to date flyctl and dockerfile-node may be important. Updating flyctl would verify that this problem has not already been fixed. Before running launch again, remove any line in your package.json that contains @flydotio/dockerfile.

If all else fails, can you post your package.json file and I’ll try to reproduce the problem.

Yes I had just updated flyctl before trying launch / posting that, it should be the latest version.

Edit: Now there is a newer version available again though… I’ll update, clean the package.json as instructed above, and try once more…

Edit2: Seems like it worked now. :partying_face:

1 Like

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