# Deploy an OCI image?

**URL:** <https://community.fly.io/t/deploy-an-oci-image/3126>\
**Category:** General\
**Tags:** wishlist\
**Created:** [November 12, 2021, 5:35pm UTC](https://community.fly.io/t/deploy-an-oci-image/3126 "2021-11-12T17:35:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nagisa](https://avatars.discourse-cdn.com/v4/letter/n/3da27b/32.png) [@nagisa](https://community.fly.io/u/nagisa)\
**Post date:** [November 12, 2021, 5:35pm UTC](https://community.fly.io/t/deploy-an-oci-image/3126/1 "2021-11-12T17:35:31Z")

</div>

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 load`ed into docker itself (and deployed from there?). It would be ideal if it was possible to forego this intermediate step entirely.

---

<div class="post-metadata">

**Author:** ![michael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/michael/32/16_2.png) [@michael](https://community.fly.io/u/michael)\
**Post date:** [November 12, 2021, 6:10pm UTC](https://community.fly.io/t/deploy-an-oci-image/3126/2 "2021-11-12T18:10:18Z")

</div>

You can use whatever tool you want to produce the OCI image, but it needs to be in [registry.fly.io](http://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.

---

<div class="post-metadata">

**Author:** ![nagisa](https://avatars.discourse-cdn.com/v4/letter/n/3da27b/32.png) [@nagisa](https://community.fly.io/u/nagisa)\
**Post date:** [November 12, 2021, 8:01pm UTC](https://community.fly.io/t/deploy-an-oci-image/3126/3 "2021-11-12T20:01:42Z")

</div>

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

```auto
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.
