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!
Learn different ways to containerize a Java application in the Container Image section.
Deploy
Enable API
1
# To use Cloud Run
2
gcloud services enable run.googleapis.com
Copied!
Deploy Container
1
PROJECT_ID=$(gcloud config get-value project)
2
​
3
gcloud run deploy helloworld \
4
--region=us-central1 \
5
--platform=managed \
6
--allow-unauthenticated \
7
--image=gcr.io/${PROJECT_ID}/helloworld
Copied!
Connect
Once deployed, Cloud Run will display the HTTPs URL. You can also find the URL with the command line:
1
gcloud run services describe helloworld \
2
--region=us-central1 \
3
--platform=managed
Copied!
You can curl the URL:
1
URL=$(gcloud run services describe helloworld \
2
--region=us-central1 \
3
--platform=managed \
4
--format='value(status.address.url)')
5
​
6
curl${URL}
Copied!
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:
1
PROJECT_ID=$(gcloud config get-value project)
2
​
3
gcloud run deploy helloworld --platform=managed --allow-unauthenticated \