From 74164c226695827638a7593837b15b070b6e1d7a Mon Sep 17 00:00:00 2001 From: Kilian Ciuffolo Date: Thu, 25 Jun 2015 15:17:28 -0700 Subject: [PATCH 1/3] added DOKKU_DOCKERFILE_START_CMD support --- dokku | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dokku b/dokku index 6316a5a5e..8f49997e7 100755 --- a/dokku +++ b/dokku @@ -89,7 +89,11 @@ case "$1" in BIND_EXTERNAL=$(pluginhook bind-external-ip $APP) [[ -n "$DOKKU_BUILDSTEP" ]] && START_CMD="/start $PROC_TYPE" - [[ -z "$DOKKU_BUILDSTEP" ]] && DOKKU_DOCKERFILE_PORT=$(dokku config:get $APP DOKKU_DOCKERFILE_PORT || true) + + if [[ -z "$DOKKU_BUILDSTEP" ]];then + DOKKU_DOCKERFILE_PORT=$(dokku config:get $APP DOKKU_DOCKERFILE_PORT || true) + START_CMD=$(dokku config:get $APP DOKKU_DOCKERFILE_START_CMD) + fi if [[ "$BIND_EXTERNAL" = "false" ]] && [[ "$PROC_TYPE" == "web" ]];then port=${DOKKU_DOCKERFILE_PORT:=5000} From 4a4ae9cb71a191e40f0561c6adbea509c70653b2 Mon Sep 17 00:00:00 2001 From: Kilian Ciuffolo Date: Thu, 25 Jun 2015 18:05:03 -0700 Subject: [PATCH 2/3] not fail if DOKKU_DOCKERFILE_START_CMD is not set --- dokku | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dokku b/dokku index 8f49997e7..8df8756d5 100755 --- a/dokku +++ b/dokku @@ -92,7 +92,7 @@ case "$1" in if [[ -z "$DOKKU_BUILDSTEP" ]];then DOKKU_DOCKERFILE_PORT=$(dokku config:get $APP DOKKU_DOCKERFILE_PORT || true) - START_CMD=$(dokku config:get $APP DOKKU_DOCKERFILE_START_CMD) + START_CMD=$(dokku config:get $APP DOKKU_DOCKERFILE_START_CMD || $START_CMD) fi if [[ "$BIND_EXTERNAL" = "false" ]] && [[ "$PROC_TYPE" == "web" ]];then From 5ced063d3d216b2b410a5647f3203ebae06a3ff3 Mon Sep 17 00:00:00 2001 From: Kilian Ciuffolo Date: Thu, 2 Jul 2015 17:47:58 -0700 Subject: [PATCH 3/3] added docs --- docs/application-deployment.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/application-deployment.md b/docs/application-deployment.md index 11ab783c1..7cb332b20 100644 --- a/docs/application-deployment.md +++ b/docs/application-deployment.md @@ -56,6 +56,20 @@ Deployment of `Dockerfile` repos is supported as of v0.3.15. Simply place a Dock By default, we will extract the first `EXPOSE` port and tell nginx to proxy your app to that port. Alternatively, you can set `$DOCKERFILE_PORT` in your app's dokku configuration. +By default no arguments are passed to `docker run` when deploying the container and the `CMD` or `ENTRYPOINT` defined in the `Dockerfile` are executed. You can take advantage of docker ability of overriding the `CMD` or passing parameters to your `ENTRYPOINT` setting `$DOKKU_DOCKERFILE_START_CMD`. Let's say for example you are deploying a base nodejs image, with the following `ENTRYPOINT`: + +``` +ENTRYPOINT ["node"] +``` + +You can do: + +``` +dokku config:set DOKKU_DOCKERFILE_START_CMD="--harmony server.js" +``` + +To tell docker what to run. + Setting `$DOKKU_DOCKERFILE_CACHE_BUILD` to `true` or `false` will enable or disable docker's image layer cache. Lastly, for more granular build control, you may also pass any `docker build` option to `docker`, by setting `$DOKKU_DOCKER_BUILD_OPTS`. ## Default vhost