hands-on lab

Build and Deploy a Container Application with Google Cloud Run

Difficulty: Intermediate
Duration: Up to 40 minutes
Students: 2,655
Rating: 4.3/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Cloud Run is a managed compute platform that automatically scales your stateless containers. Google Cloud Run is a serverless service, meaning you only need to think about your code; you write it, you test it and then you can deploy it by using Cloud Run. Everything related to the platform: CPU, memory, and networking are managed by Cloud Run. Because Cloud Run uses containers you don't need to worry about whether your preferred programming language is supported or handling dependencies. Everything is in the container and just runs. In this Lab, you will build a Docker image that refers to a simple Python application by using Cloud Build, then you will deploy the application by using Cloud Run. You will also monitor and get logs of your application by using the Cloud Run Console.

Learning Objectives

Upon completion of this Lab you will be able to:

  • Deploy a container application to Google Cloud Run
  • Monitor a running application by using Cloud Run Console

Intended Audience

This Lab is intended for:

  • Google Cloud Associate Cloud Engineer (ACE) certification candidates
  • Individuals who want to improve their skills in the serverless deployment area by using Google services
  • Solutions Architects who want to move their container applications to serverless

Prerequisites

Basic knowledge of Docker is a plus but it is not required.

Updates

April 24th, 2024 - Updated lab to use Artifact Registry

March 29th, 2022 - Updated the instructions and screenshots to reflect the latest UI

January 8th, 2020 - Updated lab to use a GCE instance rather than Cloud Shell to avoid availability issues

December 24th, 2020 - Updated Cloud Build command to account for cases when the Cloud Shell project is not configured

December 23rd, 2019 - Updated instructions and screenshots to reflect the latest console experience

Environment before

Environment after

Covered topics

Lab steps

Signing In to the Google Cloud Console
Creating a Sample Python Application
Containerizing a Python Application using Cloud Build
Deploying a Containerized Application to Cloud Run
Monitoring and Getting Logs Using the Cloud Run Console