github.com/techend/deis@v1.0.1-0.20141111224634-e0eee0392b8a/builder/slugrunner/README.md (about) 1 # (Heroku-ish) Slug Runner 2 A [Docker](http://docker.io) container that runs Heroku-like [slugs](https://devcenter.heroku.com/articles/slug-compiler) produced by [slugbuilder](https://github.com/flynn/slugbuilder). 3 4 ## What does it do exactly? 5 6 It takes a gzipped tarball of a "compiled" application via stdin or from a URL, letting you run a command in that application environment, or start a process defined in the application Procfile. 7 8 ## Using Slug Runner 9 10 First, you need Docker. Then you can either pull the image from the public index: 11 12 $ docker pull flynn/slugrunner 13 14 Or you can build from this source: 15 16 $ cd slugrunner 17 $ make 18 19 When you run the container, it always expects an app slug to be passed via stdin or by giving it a URL using the SLUG_URL environment variable. Lets run a Rake task that our app uses, attaching to stdout: 20 21 $ cat myslug.tgz | docker run -i -a stdin -a stdout flynn/slugrunner rake mytask 22 23 We can also load slugs using the SLUG_URL environment variable. This is currently the only way to run interactively, for example running Bash: 24 25 $ docker run -e SLUG_URL=http://example.com/slug.tgz -i -t flynn/slugrunner /bin/bash 26 27 Commands are run in the application environment, in the root directory of the application, with any default environment variables, and scripts sourced from .profile.d of the application. 28 29 Lastly there is a `start` command that will run any of the process types defined in the Procfile of the app, or of the default process types defined by the buildpack that built the app. For example, here we can start the `web` process: 30 31 $ cat myslug.tgz | docker run -i -a stdin -a stdout -a stderr flynn/slugrunner start web 32 33 ## Service Discovery 34 35 The runner can also register with [go-discover](https://github.com/flynn/go-discover) based service discovery using [sdutil](https://github.com/flynn/sdutil). If `$SD_NAME` and `$PORT` environment variables are set, the command is run with `sdutil exec $SD_NAME:$PORT`. `$SD_NAME` is unset before the command is run, but `$PORT` is left set since it is often used without service discovery. 36 37 It is also possible to fully customize the command line for `sdutil` tool using `$SD_ARGS`. 38 39 ## Base Environment 40 41 The Docker image here is based on [cedarish](https://github.com/progrium/cedarish), an image that emulates the Heroku Cedar stack environment. App slugs should include everything they need to run, but if something is missing it should be added upstream to cedarish. 42 43 ## License 44 45 BSD 46 47 ## Flynn 48 49 [Flynn](https://flynn.io) is a modular, open source Platform as a Service (PaaS). 50 51 If you're new to Flynn, start [here](https://github.com/flynn/flynn). 52 53 ### Status 54 55 Flynn is in active development and **currently unsuitable for production** use. 56 57 Users are encouraged to experiment with Flynn but should assume there are stability, security, and performance weaknesses throughout the project. This warning will be removed when Flynn is ready for production use. 58 59 Please report bugs as issues on the appropriate repository. If you have a general question or don't know which repo to use, report them [here](https://github.com/flynn/flynn/issues). 60 61 ## Contributing 62 63 We welcome and encourage community contributions to Flynn. 64 65 Since the project is still unstable, there are specific priorities for development. Pull requests that do not address these priorities will not be accepted until Flynn is production ready. 66 67 Please familiarize yourself with the [Contribution Guidelines](https://flynn.io/docs/contributing) and [Project Roadmap](https://flynn.io/docs/roadmap) before contributing. 68 69 There are many ways to help Flynn besides contributing code: 70 71 - Fix bugs or file issues 72 - Improve the [documentation](https://github.com/flynn/flynn.io) including this website 73 - [Contribute](https://flynn.io/#sponsor) financially to support core development 74 75 Flynn is a [trademark](https://flynn.io/docs/trademark-guidelines) of Apollic Software, LLC.