Can I git pull from a fly.io remote?

I recently used Fly.io’s Heroku migration tool to move an app over from Heroku. The wizard was so fast and easy (yay!) that I have no idea what happened. When reading through the manual migration docs, it looks like Fly.io automatically created a fly.toml file for me, updated my .gitignore, and probably generated some docker files that now reside on Fly.io’s servers. I don’t have a copy of this locally or in my GitHub repo. How can I pull these new files down so that I have them locally? In Heroku, I could pull from the heroku remote. I don’t know how to handle getting these files in Fly.io.

Hi!

You can get a copy of your fly.toml using the command fly config save -a APPNAME then you’re pretty much good to go

1 Like

It looks like I’m still missing some files.

$ fly deploy -a APPNAME
Update available 0.0.390 -> v0.0.391.
Run "fly version update" to upgrade.
==> Verifying app config
--> Verified app config
==> Building image
Error failed to fetch an image or build from source: app does not have a Dockerfile or buildpacks configured. See https://fly.io/docs/reference/configuration/#the-build-section

The error message points to the build section which talks about the build, buildpacks, or a docker image. The fly.toml file that I copied via fly config save -a APPNAME doesn’t have any of those sections. I’m not sure why it wouldn’t be accurate since I just copied it down. Do you know how I can copy a dockerfile? Based on what this person says, I’m thinking I need one. Strangely, the docs for building a new rails app don’t mention needing a dockerfile or buildpacks.

I’ve just verified it and you’re correct, my mistake!

The most reliable way you can to get this Dockerfile would be using our command fly turboku that does the same as the UI launcher. This will scan your repo and prepare a Dockerfile for you.

That being said this Dockefile is very generic and would possibly create a huge image (which is the same as you get from using the UI launcher, to be honest) one alternative to make your image smaller and deploys possibly faster would be using a Dockerfile generated by fly launch for you too (or creating a Dockerfile yourself if you like to make it as small as possible).

I ended up deleting my app and starting over using the fly launch approach. That has worked well except for the database side of things. If I get that resolved, I’ll update this post with a link to the solution.

1 Like