Home

Awesome

Serverless Docker

Swarm makes it incredibly easy to run code on your infrastructure. You wrap some code up inside a Docker container, and Swarm will make it run on whatever free resources you have.

But what if those containers could also run other containers on a Swarm? We could put pieces of our application inside containers that are run on-demand on a Swarm. Docker containers can be used as functions from within other applications:

>>> import dockerrun
>>> client = dockerrun.from_env()
>>> client.run("bfirsh/leftpad", ["foo", "5"])
'  foo\n'

Take, for example, running background tasks in a web app. In a traditional architecture, you would have a set of task workers and a message queue to pass work from the web frontends to the task workers.

If your web frontends have access to a Swarm, you can run the task directly on your Swarm:

client.run("tasks/reticulate-splines", detach=True)

To read more about this, check out this blog post.

Examples

## Reading

Tools

## Client libraries

Stuff that needs working on

We need your help!