Use the following environment variables to configure the behavior of your services when deployed to either Cloud Run or Cloud Run functions.
Learn how to set these environment variable in your container image.
For configuration details about a specific language, see:
Cloud Run and Cloud Run functions environment variables
The following configurations support building services for both applications and functions. For more Cloud Run functions environment variables, see additional Cloud Run functions environment variables.
GOOGLE_ENTRYPOINT
Specifies the command that is run when your container is executed. This is equivalent to entrypoint in a Dockerfile.
Examples:
Cloud Run source deploy
- Java:
java -jar target/myjar.jar - PHP:
php -S 0.0.0.0:8080 index.php - Python:
The Python buildpack sets the default entrypoint for Cloud Run source deployments. For Python version 3.13
and later, the Python buildpack sets the entrypoint based on the web service configuration in your requirements.txt file. If you don't specify a
web server or framework in the requirements.txt file, or use Python version 3.12 and earlier, the Python buildpack sets the default entrypoint to gunicorn -b :8080 main:app. For more information, see Building a Python application.
All other deployments
- Java:
java -jar target/myjar.jar - PHP:
php -S 0.0.0.0:8080 index.php - Python:
gunicorn -b :8080 main:app
GOOGLE_RUNTIME
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
opt-in.
GOOGLE_RUNTIME_VERSION
Specifies the version of your runtime to install. For .NET, specifies the .NET SDK version.
Examples:
- Go:
1.25.1 - Java:
25 - Node.js:
24.1.0 - .NET:
10.0.101
GOOGLE_BUILDABLE
For Go, Java, Dart, and .NET runtimes: Specifies path to a buildable unit.
Go example: Specifying ./maindir builds the package rooted at maindir.
GOOGLE_BUILD_ARGS
For Java (Maven and Gradle) and .NET runtimes: Appends arguments to the build command.
Java example: Specifying -Pprod runs mvn clean package ... -Pprod.
GOOGLE_MAVEN_BUILD_ARGS
For Java runtimes using the Maven plugin: Overrides the default Maven command with the build command that you specify.
When GOOGLE_MAVEN_BUILD_ARGS is not specified, the following command is run
by default:
mvn clean package --batch-mode -DskipTests -Dhttp.keepAlive=false
Example: Specifying GOOGLE_MAVEN_BUILD_ARGS="clean package: runs
the mvn clean package command.
GOOGLE_GRADLE_BUILD_ARGS
For Java runtimes using the Gradle plugin: Overrides the default Gradle command with the build command that you specify.
When GOOGLE_GRADLE_BUILD_ARGS is not specified, the following command is run
by default:
gradle clean assemble -x test