File: //snap/google-cloud-cli/394/help/man/man1/gcloud_alpha_code_dev.1
.TH "GCLOUD_ALPHA_CODE_DEV" 1
.SH "NAME"
.HP
gcloud alpha code dev \- run a Cloud Run service in a local development environment
.SH "SYNOPSIS"
.HP
\f5gcloud alpha code dev\fR [\fISERVICE_CONFIG\fR] [\fB\-\-[no\-]allow\-secret\-manager\fR] [\fB\-\-cloudsql\-instances\fR=[\fICLOUDSQL_INSTANCE\fR,...]] [\fB\-\-cpu\fR=\fICPU\fR] [\fB\-\-image\fR=\fIIMAGE\fR] [\fB\-\-local\-port\fR=\fILOCAL_PORT\fR] [\fB\-\-memory\fR=\fIMEMORY\fR] [\fB\-\-minikube\-vm\-driver\fR=\fIMINIKUBE_VM_DRIVER\fR;\ default="docker"] [\fB\-\-namespace\fR=\fINAMESPACE\fR] [\fB\-\-secrets\fR=[\fIKEY\fR=\fIVALUE\fR,...]] [\fB\-\-service\-name\fR=\fISERVICE_NAME\fR] [\fB\-\-source\fR=\fISOURCE\fR] [\fB\-\-no\-stop\-cluster\fR] [\fB\-\-application\-default\-credential\fR\ |\ \fB\-\-service\-account\fR=\fISERVICE_ACCOUNT\fR] [\fB\-\-builder\fR=\fIBUILDER\fR\ |\ \fB\-\-dockerfile\fR=\fIDOCKERFILE\fR;\ default="Dockerfile"] [\fB\-\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]\ |\ \fB\-\-env\-vars\-file\fR=\fIFILE_PATH\fR] [\fB\-\-kube\-context\fR=\fIKUBE_CONTEXT\fR\ |\ \fB\-\-minikube\-profile\fR=\fIMINIKUBE_PROFILE\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR Run a Cloud Run service in a local development environment.
This command takes Cloud Run source, builds it, and runs it on the local
machine. This command also watches the relevant source files and updates the
container when they change.
.SH "EXAMPLES"
If building images using a Dockerfile:
.RS 2m
$ gcloud alpha code dev \-\-dockerfile=<path_to_dockerfile>
.RE
If the Dockerfile is named \f5Dockerfile\fR and is located in the current
directory, the \f5\-\-dockerfile\fR flag may be omitted:
.RS 2m
$ gcloud alpha code dev
.RE
To access Google Cloud Platform services with the current user's credentials,
login to obtain the application default credentials and invoke this command with
the \f5\-\-application\-default\-credential\fR flag.
.RS 2m
$ gcloud auth application\-default login
$ gcloud alpha code dev \-\-dockerfile=<path_to_dockerfile> \e
\-\-application\-default\-credential
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
[\fISERVICE_CONFIG\fR]
service.yaml filename override. Defaults to the first file matching
\f5*service.dev.yaml\fR then \f5*service.yaml\fR, if any exist. This path is
relative to the \-\-source dir. An App Engine config path (typically
\f5app.yaml\fR) may also be provided here, and we will build with a Cloud Native
Computing Foundation Buildpack builder selected from
gcr.io/gae\-runtimes/buildpacks, according to the App Engine \f5runtime\fR
specified in app.yaml.
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-[no\-]allow\-secret\-manager\fR
Suppress warnings if secrets need to be pulled from secret manager. Use
\fB\-\-allow\-secret\-manager\fR to enable and
\fB\-\-no\-allow\-secret\-manager\fR to disable.
.TP 2m
\fB\-\-cloudsql\-instances\fR=[\fICLOUDSQL_INSTANCE\fR,...]
Cloud SQL instance connection strings. Must be in the form
<project>:<region>:<instance>.
.TP 2m
\fB\-\-cpu\fR=\fICPU\fR
Container CPU limit. Limit is expressed as a number of CPUs. Fractional CPU
limits are allowed (e.g. 1.5).
.TP 2m
\fB\-\-image\fR=\fIIMAGE\fR
Name for the built image.
.TP 2m
\fB\-\-local\-port\fR=\fILOCAL_PORT\fR
Local port to which the service connection is forwarded. If this flag is not
set, then a random port is chosen.
.TP 2m
\fB\-\-memory\fR=\fIMEMORY\fR
Container memory limit. Limit is expressed either as an integer representing the
number of bytes or an integer followed by a unit suffix. Valid unit suffixes are
"B", "KB", "MB", "GB", "TB", "KiB", "MiB", "GiB", "TiB", or "PiB".
.TP 2m
\fB\-\-minikube\-vm\-driver\fR=\fIMINIKUBE_VM_DRIVER\fR; default="docker"
If running on minikube, use this vm driver.
.TP 2m
\fB\-\-namespace\fR=\fINAMESPACE\fR
Kubernetes namespace for development kubernetes objects.
.TP 2m
\fB\-\-secrets\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as secrets.
.TP 2m
\fB\-\-service\-name\fR=\fISERVICE_NAME\fR
Name of the service.
.TP 2m
\fB\-\-source\fR=\fISOURCE\fR
The directory containing the source to build. If not specified, the current
directory is used.
.TP 2m
\fB\-\-stop\-cluster\fR
If running on minikube, stop the minkube profile at the end of the session.
Enabled by default, use \fB\-\-no\-stop\-cluster\fR to disable.
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-application\-default\-credential\fR
When connecting to Google Cloud Platform services, use the application default
credential.
.TP 2m
\fB\-\-service\-account\fR=\fISERVICE_ACCOUNT\fR
When connecting to Google Cloud Platform services, use a service account key.
.RE
.sp
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-builder\fR=\fIBUILDER\fR
Build with a given Cloud Native Computing Foundation Buildpack builder.
.TP 2m
\fB\-\-dockerfile\fR=\fIDOCKERFILE\fR; default="Dockerfile"
Dockerfile for the service image.
.RE
.sp
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-env\-vars\fR=[\fIKEY\fR=\fIVALUE\fR,...]
List of key\-value pairs to set as environment variables.
.TP 2m
\fB\-\-env\-vars\-file\fR=\fIFILE_PATH\fR
Path to a local YAML file with definitions for all environment variables.
.RE
.sp
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-kube\-context\fR=\fIKUBE_CONTEXT\fR
Kubernetes context.
.TP 2m
\fB\-\-minikube\-profile\fR=\fIMINIKUBE_PROFILE\fR
Minikube profile.
.RE
.RE
.sp
.SH "GCLOUD WIDE FLAGS"
These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.
Run \fB$ gcloud help\fR for details.
.SH "NOTES"
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. This variant is also available:
.RS 2m
$ gcloud beta code dev
.RE