Use the following environment variables to configure the behavior of your services when deployed to either Cloud Run or Cloud Functions.
Cloud Run and Cloud Functions environment variables
The following configurations support building services for both applications and functions. Also see the additional Cloud Functions environment variables below.
Specifies the command that is run when your container is executed. This is equivalent to entrypoint in a Dockerfile.
java -jar target/myjar.jar
php -S 0.0.0.0:8080 index.php
gunicorn -p :8080 main:app
Forces the runtime to opt-in. If the runtime buildpack image appears in multiple groups, the buildpack image in the first group is used across all groups.
Node.js example: Specifying
nodejs forces the Node.js runtime buildpack to
Specifies the version of your runtime to install. For .NET, specifies the .NET SDK version.
For Go, Dart, and .NET runtimes: Specifies path to a buildable unit.
Go example: Specifying
./maindir builds the package rooted at
For Java (Maven and Gradle) and .NET runtimes: Appends arguments to the build command.
Java example: Specifying
mvn clean package ... -Pprod.
For Skaffold: Enables the development mode buildpacks.
Use live local development to trigger automatic container rebuilds for changes
to your source code. You must install Skaffold and run
- Supported values:
For functions and Go or Java applications: Clears source after the application is built. If the application depends on static files, such as Go templates, setting this variable may cause the application to misbehave.
Additional Cloud Functions environment variables
The following configurations are only available for source code built as functions that use Functions Framework and Cloud Functions. For more information about these configuration option, see the contract.
- Specifies the name of the exported function to be invoked in response to requests.
myFunctionwill cause the Functions Framework to invoke the function of the same name.
- Specifies the signature used by the function.
- Specifies the name of the directory or file containing the function source, depending on the language.
- (Only applicable to some languages, please see the language-specific documentation.)