Gourmet is a work in progress application
that allow you to execute little applications on an isolated environment, it
dowloads your manifest and runs it in a container.
I start this application to improve my go knowledge and to work with the Docker API
I am happy to share my idea and my tests with Swam an easy way to scale this type of application.
Gourmet exposes an HTTP API available at the /project endpoint that accept a JSON request body like:
img is the started point docker image
source is your script
env is a list of environment variables that you can use on your script
During my test I use this php script that send a message on SQS.
Your script has a console entrypoint executables in this path /bin/console and
gourmet uses it to run your program.
To integrate it with Docker I used fsouza/go-dockerclient an open source
library written in go.
This is a snippet that can be used to create a new container.
With the container started I use the exec feature to
extract your source and to run it.
After each build Gourmet cleans all and destroies the environment.
At the moment it is gourmet, It could be different hypothetical use cases:
high separated task
run a testsuite
dispatch specific functions
A microservice to work with docker container easily.
I thought about an easy way to scale this application and I found
Swarm, it is a native cluster for docker and
it seems awesome in first because it is compatibile with the docker api.