extract first port from Dockerfile and set config variable for use in deploy phase. closes #993

This commit is contained in:
Michael Hobbs
2015-02-25 19:45:20 -08:00
parent fafa33e40d
commit 2834ce1f1a
4 changed files with 16 additions and 3 deletions

View File

@@ -34,6 +34,9 @@ case "$1" in
;;
dockerfile)
# extract first port from Dockerfile
DOCKERFILE_PORT=$(grep EXPOSE Dockerfile | head -1 | awk '{ print $2 }')
[[ -n "$DOCKERFILE_PORT" ]] && dokku config:set $APP DOKKU_DOCKERFILE_PORT=$DOCKERFILE_PORT
# sticking with same pattern of building app image before pre-build for now.
docker build -t "$IMAGE" .
# buildstep pluginhooks don't necessarily make sense for dockerfiles. call the new breed!!!