gcloud beta code dev Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud beta code dev - run a Cloud Run service in a local development environment
- SYNOPSIS
gcloud beta code dev[SERVICE_CONFIG][--[no-]allow-secret-manager][--local-port=LOCAL_PORT][--secrets=[KEY=VALUE,…]][--source=SOURCE][--no-stop-cluster][--application-default-credential|--service-account=SERVICE_ACCOUNT][--builder=BUILDER|--dockerfile=DOCKERFILE; default="Dockerfile"][--kube-context=KUBE_CONTEXT|--minikube-profile=MINIKUBE_PROFILE][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(BETA)Run a Cloud Run service in a local development environment.This command takes Cloud Run source, builds it, and runs it on the localmachine. This command also watches the relevant source files and updates thecontainer when they change.
- EXAMPLES
- If building images using a Dockerfile:
gcloudbetacodedev--dockerfile=<path_to_dockerfile>If the Dockerfile is named
Dockerfileand is located in the currentdirectory, the--dockerfileflag may be omitted:gcloudbetacodedevTo access Google Cloud Platform services with the current user's credentials,login to obtain the application default credentials and invoke this command withthe
--application-default-credentialflag.gcloudauthapplication-defaultlogingcloudbetacodedev--dockerfile=<path_to_dockerfile>--application-default-credential - POSITIONAL ARGUMENTS
- [
SERVICE_CONFIG] - service.yaml filename override. Defaults to the first file matching
*service.dev.yamlthen*service.yaml, if any exist.This path is relative to the --source dir.
- [
- FLAGS
--[no-]allow-secret-manager- Suppress warnings if secrets need to be pulled from secret manager. Use
--allow-secret-managerto enable and--no-allow-secret-managerto disable. --local-port=LOCAL_PORT- Local port to which the service connection is forwarded. If this flag is notset, then a random port is chosen.
--secrets=[KEY=VALUE,…]- List of key-value pairs to set as secrets.
--source=SOURCE- The directory containing the source to build. If not specified, the currentdirectory is used.
--stop-cluster- If running on minikube, stop the minkube profile at the end of the session.Enabled by default, use
--no-stop-clusterto disable. - At most one of these can be specified:
--application-default-credential- When connecting to Google Cloud Platform services, use the application defaultcredential.
--service-account=SERVICE_ACCOUNT- When connecting to Google Cloud Platform services, use a service account key.
- At most one of these can be specified:
--builder=BUILDER- Build with a given Cloud Native Computing Foundation Buildpack builder.
--dockerfile=DOCKERFILE; default="Dockerfile"- Dockerfile for the service image.
- At most one of these can be specified:
--kube-context=KUBE_CONTEXT- Kubernetes context.
--minikube-profile=MINIKUBE_PROFILE- Minikube profile.
- 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
$gcloud helpfor details. - NOTES
- This command is currently in beta and might change without notice. This variantis also available:
gcloudalphacodedev
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-07 UTC.