0
0
GCPcloud~10 mins

Deploying container images in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the container image URL in the deployment command.

GCP
gcloud run deploy my-service --image=[1] --region us-central1
Drag options to blanks, or click blank then click option'
Agcloud container images list
Bmy-image
Cdocker run my-image
Dgcr.io/my-project/my-image:latest
Attempts:
3 left
💡 Hint
Common Mistakes
Using only the image name without the registry URL.
Including docker commands instead of image URL.
Listing images instead of specifying one.
2fill in blank
medium

Complete the command to build a container image using Cloud Build.

GCP
gcloud builds submit --tag [1] .
Drag options to blanks, or click blank then click option'
Agcr.io/my-project/my-image:latest
Bmy-image
Cdocker build
Dgcloud run deploy
Attempts:
3 left
💡 Hint
Common Mistakes
Using only the image name without registry.
Using unrelated commands like docker build or gcloud run deploy.
3fill in blank
hard

Fix the error in the deployment command by completing the missing flag.

GCP
gcloud run deploy my-service [1] gcr.io/my-project/my-image:latest --region us-central1
Drag options to blanks, or click blank then click option'
A--image
B--service-account
C--platform
D--project
Attempts:
3 left
💡 Hint
Common Mistakes
Using --project instead of --image.
Omitting the flag entirely.
Using unrelated flags like --platform or --service-account.
4fill in blank
hard

Fill both blanks to create a Dockerfile that sets the base image and exposes port 8080.

GCP
FROM [1]
EXPOSE [2]
Drag options to blanks, or click blank then click option'
Apython:3.12-slim
B80
C8080
Dnode:18-alpine
Attempts:
3 left
💡 Hint
Common Mistakes
Exposing port 80 instead of 8080.
Using a Node.js base image for a Python app.
Omitting the EXPOSE instruction.
5fill in blank
hard

Fill all three blanks to define a Cloud Run service deployment with memory limit, concurrency, and environment variable.

GCP
gcloud run deploy my-service --image gcr.io/my-project/my-image:latest --memory=[1] --concurrency=[2] --set-env-vars=[3]
Drag options to blanks, or click blank then click option'
A512Mi
B80
CENV=production
D1Gi
Attempts:
3 left
💡 Hint
Common Mistakes
Using memory units incorrectly.
Setting concurrency too high or too low without reason.
Incorrect format for environment variables.