1 | # Heroku CLI Docker Plugin
|
2 |
|
3 | Develop with Docker. Deploy to Heroku.
|
4 |
|
5 | ## OSX Prerequisite: boot2docker or similar
|
6 |
|
7 | If you already have some mechanism of hosting Docker locally, you can skip this step.
|
8 | If you're new to Docker on OSX, we recommend
|
9 | [installing boot2docker](http://boot2docker.io/).
|
10 |
|
11 | Before using Heroku-Docker, you should make sure `docker` works in your shell:
|
12 |
|
13 | ```
|
14 | docker ps
|
15 | ```
|
16 |
|
17 | If you see errors there, you may need to initialize boot2docker:
|
18 |
|
19 | ```
|
20 | boot2docker stop && boot2docker start
|
21 | $(boot2docker shellinit)
|
22 | ```
|
23 |
|
24 | You can do this init in your bash profile; that's out of scope for these docs.
|
25 |
|
26 | ## Install the latest plugin
|
27 |
|
28 | ```
|
29 | heroku plugins:uninstall heroku-docker
|
30 | heroku plugins:install heroku-docker
|
31 | ```
|
32 |
|
33 | ## Tutorials
|
34 |
|
35 | - [Starting a new Node.js project](docs/new-project.md)
|
36 | - [Dockerizing Heroku's Node.js getting started project](docs/node-getting-started.md)
|
37 | - [Hacking on this plugin](docs/hacking.md)
|
38 |
|
39 | ## Plugin API
|
40 |
|
41 | ### `docker:init [--template <templateName>]`
|
42 |
|
43 | Initializes a Dockerfile in the current directory.
|
44 |
|
45 | If --template is provided, uses that Dockerfile template.
|
46 | All templates are in /platforms.
|
47 | If no template is provided,
|
48 | runs `detect` on each platform to see if a platform can be detected.
|
49 | If nothing is detected, creates a Dockerfile from a default 'minimal' template
|
50 | based on Heroku's Cedar-14 stack.
|
51 |
|
52 | ### `docker:exec <command string>`
|
53 |
|
54 | Mounts the current directory into a container built from the Dockerfile,
|
55 | then executes the provided command.
|
56 |
|
57 | ### `docker:start [ process type ]`
|
58 |
|
59 | Copies the current directory into a container built from the Dockerfile,
|
60 | then executes the process type specified (`web` by default).
|
61 |
|
62 | When starting a `web` process, `docker:start` provides the web server's URL.
|
63 |
|
64 | ### `docker:release`
|
65 |
|
66 | Builds a slug within the local container then releases it to a Heroku app
|
67 | via the Heroku Platform API.
|
68 | Creates any containers necessary for the build automatically.
|
69 |
|
70 | ### `docker:clean`
|
71 |
|
72 | Removes all Heroku-Docker images from the Docker host.
|
73 |
|
74 | ## Testing
|
75 |
|
76 | `npm test`
|
77 |
|
78 | - Assumes that `docker` is accessible
|
79 | - Assumes that it's being run in a directory that the docker host (like boot2docker) can mount
|