Cloud Run

Deploy a container to serverless environment using a single command.

Cloud Run is a fully managed container runtime environment, where you can deploy any HTTP serving container, and Cloud Run will automatically scale out the number of instances as needed, and scale down to zero when no one is using it.

Getting Started - Click to Deploy

You can deploy a Hello World Application simply by click on the Run on Google Cloud button below!

Deploy a Spring Boot app on Cloud Run

Getting Started - Manual Deployment

Clone

cd $HOME
git clone https://github.com/saturnism/jvm-helloworld-by-example
cd jvm-helloworld-by-example/helloworld-springboot-tomcat

Build

./mvnw package

Containerize

Enable API

Enable the Container Registry API so that you can push container images to Container Registry.

Jib

Use Jib to containerize the application:

Learn different ways to containerize a Java application in the Container Image section.

Deploy

Enable API

Deploy Container

Connect

Once deployed, Cloud Run will display the HTTPs URL. You can also find the URL with the command line:

You can curl the URL:

Additional Configurations

By default, Cloud Run will deploy with the smallest 1CPU 256MB instance. You can specify a larger instance, and configure environment variables with the gcloud CLI:

Learn More

Last updated

Was this helpful?