October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Mountain View desk4 min

Deploy a Containerized App to Google Cloud Run: A Practical Walkthrough

A practical Google Cloud Run deployment walkthrough covering image deployment, the required PORT binding, access settings, revision behavior, troubleshooting, and cleanup.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To deploy an existing container image to Google Cloud Run, prepare a Google Cloud project with billing enabled, then create a Cloud Run service from the image in the console or with gcloud run deploy SERVICE --image IMAGE_URL. The key details are to make the container listen on Cloud Run’s injected PORT, choose public or authenticated access deliberately, and remember that each configuration change creates a new, immutable revision.

Prepare the Google Cloud project

Choose an existing Google Cloud project or create one, enable billing, and review current Cloud Run pricing before deploying. Google’s Cloud Run quickstart lists the Cloud Run Admin, Service Account User, and Logs Viewer roles for its procedure. Your organization’s permissions and deployment workflow may require a different role setup, so confirm access with your administrator if you cannot enable or deploy the service.

As an Amazon Associate I earn from qualifying purchases.

This walkthrough assumes you already have a container image available. Google also documents a source-repository continuous deployment route; it is a separate option for teams that want deployments tied to source changes rather than manually selecting an image.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a deployment path

Workflow Useful when What to expect
Deploy an existing image in the Google Cloud console You want to select an image and review service settings in a graphical interface. The quickstart’s console procedure creates a service from the selected container image.
Deploy an existing image with gcloud You want a repeatable command or are automating a deployment. Use gcloud run deploy SERVICE --image IMAGE_URL; supply the service name and image URL for your deployment.
Continuous deployment from a source repository You want a source-repository-based deployment workflow. Google documents this as another route; its setup is distinct from deploying a prebuilt image.

The console and CLI are different ways to deploy an image, not different runtime platforms. Pick the route that fits how you build and release the application. Google recommends Artifact Registry for container images. For Docker Hub or an Artifact Registry remote repository connected to an external registry, Google’s deployment guide documents a 9.9 GB image-layer limit; that limit applies to those registry paths, not every image deployment.

Deploy the container image

Using the console

  1. Open the Google Cloud console and select the project where the service should run.
  2. Open the Cloud Run service creation flow, choose deployment from an existing container image, and enter the image URL.
  3. Choose a service name, region, and access setting, then review the remaining service settings before creating the service.
  4. Wait for deployment to finish and open the service URL to check the application.

Using the command line

Run the documented command form with your own service name and image URL:

gcloud run deploy SERVICE --image IMAGE_URL

Replace SERVICE and IMAGE_URL with the intended service name and container image location. The service name is scoped to a project and region, must be 49 characters or fewer, and cannot be changed later. Choose it carefully before creating the service.

Cloud Run resolves an image tag to a digest for a revision. If the tag later points to a different image, that does not change the image already serving in the existing revision. A new deployment creates a new revision, and Google describes each revision as immutable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make sure the application listens on Cloud Run’s port

Cloud Run provides the listening port in the PORT environment variable. The application must bind to that value to receive requests; relying on a hardcoded development port can prevent startup. Google’s container startup troubleshooting guide says the container must listen on the port defined by Cloud Run and supplied in PORT.

If deployment reports that the container failed to start and then listen on the required port, check the image locally first, then verify that the application reads and binds to PORT. These checks address the documented startup causes without assuming that every failure has the same explanation.

Decide whether the service should be public

Access is a security choice, not just a deployment convenience. The quickstart demonstrates public access. In the deployment guide, allowing public access grants the special allUsers identity the Invoker role, so anyone can invoke the service. Use that setting only when the application is intended to be reachable without sign-in.

For a protected application, require authentication and configure the appropriate IAM access for its callers. The deployment guide explains the access options and their implications; select the one that matches the application rather than assuming that a service URL should be public.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Configure revisions and inspect failures

Cloud Run settings include CPU, memory, concurrency, timeout, scaling, ingress, environment variables, secrets, and service identity. Changing configuration creates a new revision, so check the active revision after an update. Choose resource and scaling settings for the application’s workload instead of treating one configuration as suitable for every service.

Environment variables are part of a revision’s configuration. Service-level values take precedence over defaults baked into the image. Cloud Run supports up to 1,000 environment variables, and each variable value has a 32 KB maximum length, according to Google’s environment-variable documentation.

Take care with the CLI --set-env-vars option: it replaces the configured environment-variable list. If you omit a previously configured key from the new list, that key is removed. Include every variable you intend to retain when using this flag.

For deployment or serving problems, inspect the Cloud Run logs for the deployment and request. When startup fails, begin with whether the image runs locally and whether its process listens on the supplied PORT; then use the log details to investigate the specific failure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Clean up when an experiment is finished

Google’s quickstart cleanup guidance says a Cloud Run service incurs no service charge until it receives requests, but image storage in Artifact Registry may still be billed. If you no longer need a test deployment, delete the Cloud Run service and any unused image repository. Before deleting a whole project, check for other resources in it that you still need.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.