porter create
info
A detailed guide on creating applications from the CLI can be found here.
Prerequisites
-
You’ve logged in to the Porter CLI after running porter auth login
-
You’re connected to the correct project by running porter config set-project
-
You’re connected to the correct cluster by running porter config set-cluster
porter create
creates a new application with name given by the --app
flag and a kind
, which can be one of web, worker, or job. For example:
Examples
To modify the default configuration of the application, you can pass a values.yaml file in via the --values
flag.
This command will automatically build from a local path, and will create a new Docker image in your default Docker registry. The path can be configured via the —path flag. For example:
To connect the application to Github, so that the application rebuilds and redeploys on each push to a Github branch, you can specify --source github
. If your local branch is set to track changes from an upstream remote branch, Porter will try to use the connected remote and remote branch as the Github repository to link to. Otherwise, Porter will use the remote given by origin. For example:
To deploy an application from a Docker registry, use --source registry
and pass the image in via the --image
flag. The image flag must be of the form repository:tag. For example:
Flags
--app
(string) name of the new application/job/worker.--dockerfile
(string) the path to the dockerfile-e, --env
(stringArray) Build-time environment variable, in the form ‘VAR=VALUE’. These are not available at image runtime.--image
(string) if the source is “registry”, the image to use, in repository:tag format--method
(string) the build method to use (“docker” or “pack”)--namespace
(string) namespace of the application (default “default”)-p, --path
(string) if local build, the path to the build directory--registry-url
(string) the registry URL to use (must exist in “porter registries list”)--source
(string) the type of source (“local”, “github”, or “registry”) (default “local”)-v, --values
(string) filepath to a values.yaml file