2015-04-01 12:21:45 -07:00
docker-options
========================
Usage
-----
```bash
$ dokku help
...
docker-options <app> Display apps docker options for all phases
2015-07-14 15:46:32 -07:00
docker-options <app> <phase(s)> Display apps docker options for phase (comma-separated phase list)
docker-options:add <app> <phase(s)> OPTION Add docker option to app for phase (comma-separated phase list)
docker-options:remove <app> <phase(s)> OPTION Remove docker option from app for phase (comma-separated phase list)
2015-04-01 12:21:45 -07:00
...
````
2015-06-17 08:12:46 -07:00
Add some options (first, for the deployed/running app and second when executing `dokku run` )
2015-04-01 12:21:45 -07:00
```bash
$ dokku docker-options:add myapp deploy "-v /host/path:/container/path"
$ dokku docker-options:add myapp run "-v /another/container/path"
```
Check what we added
```bash
$ dokku docker-options myapp
2015-06-17 08:12:46 -07:00
Deploy options:
2015-05-11 20:59:37 -04:00
-v /host/path:/container/path
2015-06-17 08:12:46 -07:00
Run options:
2015-05-11 20:59:37 -04:00
-v /another/container/path
2015-04-01 12:21:45 -07:00
```
Remove an option
```bash
2015-05-11 20:59:37 -04:00
$ dokku docker-options:remove myapp run "--link container_name:alias"
2015-04-01 12:21:45 -07:00
```
2015-06-17 08:12:46 -07:00
Note about `dokku` phases and `docker-options`
------------
`dokku` deploys your application in multiple "phases" and the `docker-options` plugin allows you to pass arguments to the underlying docker container in the following 3 phases/containers
- `build` : the container that executes the appropriate buildpack
- `deploy` : the container that executes your running/deployed application
- `run` : the container that executes any arbitrary command via `dokku run myapp`
2015-04-01 12:58:46 -07:00
Advanced Usage (avoid if possible)
2015-04-01 12:21:45 -07:00
------------
2015-06-17 08:12:46 -07:00
In your applications folder (`/home/dokku/app_name` ) create a file called `DOCKER_OPTIONS_RUN` (or `DOCKER_OPTIONS_BUILD` or `DOCKER_OPTIONS_DEPLOY` ).
2015-04-01 12:21:45 -07:00
Inside this file list one docker option per line. For example:
```bash
2015-05-11 20:59:37 -04:00
--link container_name:alias
2015-04-01 12:21:45 -07:00
-v /host/path:/container/path
-v /another/container/path
```
2015-06-17 08:12:46 -07:00
The above example will result in the following options being passed to docker during `dokku run` :
2015-04-01 12:21:45 -07:00
```bash
2015-05-11 20:59:37 -04:00
--link container_name:alias -v /host/path:/container/path -v /another/container/path
2015-04-01 12:21:45 -07:00
```
You may also include comments (lines beginning with a #) and blank lines in the DOCKER_OPTIONS file.
Move information on docker options can be found here: http://docs.docker.io/en/latest/reference/run/ .