Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
feat(controller): make Procfile mandatory
Browse files Browse the repository at this point in the history
At the moment, all custom Dockerfile apps will not start because the
'start' command is not present in the container. Instead, we can
generically parse the Procfile for the process type and start that
instead. This makes two important changes:

1) All applications **must** specify a Procfile
2) All custom Dockerfile apps must have access to cat, grep, cut and sh

The justification for 1) is so that we have a known place to search for
runnable processes. 2) is because of the change from `start web` to parse
the Procfile for the process types.

fixes #668
  • Loading branch information
Matthew Fisher committed Apr 28, 2014
1 parent 4c9fb7b commit b81f4a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion builder/templates/builder
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ if __name__ == '__main__':
# check for Procfile
dockerfile = os.path.join(temp_dir, 'Dockerfile')
procfile = os.path.join(temp_dir, 'Procfile')
if not os.path.exists(dockerfile) and os.path.exists(procfile):
if not os.path.exists(procfile):
raise Exception('Procfile must exist')
if not os.path.exists(dockerfile):
if os.path.exists('/buildpacks'):
build_cmd = "docker run -i -a stdin -v {cache_dir}:/tmp/cache:rw -v /buildpacks:/tmp/buildpacks deis/slugbuilder".format(**locals())
else:
Expand Down
2 changes: 1 addition & 1 deletion controller/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def _get_scheduler(self):
def _get_command(self):
c_type = self.type
if c_type:
return 'start {c_type}'
return "cat Procfile | grep ^{c_type} | cut -f 1 -d ' ' --complement | sh -"
else:
return ''

Expand Down

0 comments on commit b81f4a8

Please sign in to comment.