Packaging and distributing Spin applications

Packaging and distributing Spin applications is done using Bindle, an open source aggregate object storage system. This allows the packaging of the application manifest, components, and static assets together, and takes advantage of the features of a modern object storage system.

To distribute applications, we first need a Bindle registry. You can install Bindle v0.8 release, or use the autobindle VS Code extension (through the Bindle: Start command):

$ bindle-server --address 127.0.0.1:8000 --directory . --unauthenticated

Let’s push the application from the quickstart to the registry:

$ export BINDLE_URL=http://localhost:8000/v1
$ spin bindle push --file spin.toml
pushed: spin-hello-world/1.0.0

Now we can run the application using spin up directly from the registry:

$ spin up --bindle spin-hello-world/1.0.0

A known error when running an application (with a high number of static assets) from Bindle on macOS is around too many open files. This issue can be worked around by setting a higher ulimit -n for the current shell session.

The application can also be prepared in a local directory before pushing to the registry by running spin bindle prepare.