UNPKG

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