Deploy an OCI image?

I would like to use a non-Dockerfile mechanism to build up an image. However the way these alternative tools tend to work is by producing an OCI image as a tar.gz. This then can be later docker loaded into docker itself (and deployed from there?). It would be ideal if it was possible to forego this intermediate step entirely.

You can use whatever tool you want to produce the OCI image, but it needs to be in registry.fly.io or a publicly assessable registry to deploy. Loading a tarball into docker then pushing will work, or you can use a tool that can push the tarball straight to a registry.

Just be aware that you need to use oci-archive tarballs to maintain layers for caching. Otherwise pushes and VM launches will be noticeably slower anytime the image changes.

Thanks, this is what worked for me (I ended up using docker-archive tarballs in the end):

skopeo --insecure-policy --debug copy docker-archive:"$(nix-build)" docker://registry.fly.io/$PROJECT_NAME:latest --dest-creds x:"$(flyctl auth token)" --format v2s2
flyctl deploy -i registry.fly.io/$PROJECT_NAME:latest --remote-only 

While it isn’t super complicated, there are a number of things that must go right before things start working. If this was somehow integrated into flyctl deploy, that would be ideal.

1 Like