0
0
GCPcloud~20 mins

Pushing and pulling images in GCP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
GCR Image Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What happens when you push a Docker image to Google Container Registry?

You have built a Docker image locally and want to store it in Google Container Registry (GCR). What is the main result of pushing the image to GCR?

AThe image is uploaded and stored in GCR, making it available for other services to pull.
BThe image is converted to a virtual machine and deployed automatically.
CThe image is only stored temporarily and deleted after 24 hours.
DThe image is deleted from your local machine after upload.
Attempts:
2 left
💡 Hint

Think about what a registry does with images you push to it.

Configuration
intermediate
2:00remaining
Which command correctly tags a local Docker image for pushing to GCR?

You have a local Docker image named my-app with tag v1. Your GCP project ID is my-project. Which command correctly tags the image for pushing to Google Container Registry?

Adocker tag gcr.io/my-project/my-app:v1 my-app:v1
Bdocker tag my-app gcr.io/my-project:v1/my-app
Cdocker tag my-app:v1 my-project/gcr.io/my-app:v1
Ddocker tag my-app:v1 gcr.io/my-project/my-app:v1
Attempts:
2 left
💡 Hint

Remember the format for GCR image names: gcr.io/[PROJECT-ID]/[IMAGE]:[TAG]

Architecture
advanced
2:00remaining
What is the best architecture to securely pull images from GCR in a Kubernetes cluster?

You want your Kubernetes cluster to pull private images from Google Container Registry securely. Which architecture ensures secure and automated access?

AUse Kubernetes secrets with service account keys to authenticate image pulls.
BMake the images public in GCR so no authentication is needed.
CUse Workload Identity to allow Kubernetes service accounts to access GCR without storing keys.
DManually log in to GCR on each node using Docker credentials.
Attempts:
2 left
💡 Hint

Consider a method that avoids managing long-lived keys and automates authentication.

service_behavior
advanced
2:00remaining
What happens if you try to pull a non-existent image tag from GCR?

You run docker pull gcr.io/my-project/my-app:nonexistent but the tag nonexistent does not exist in GCR. What is the expected behavior?

ADocker returns an error saying the image or tag was not found.
BDocker pulls the latest available tag instead automatically.
CDocker pulls an empty image with no layers.
DDocker pulls the image but with default configuration.
Attempts:
2 left
💡 Hint

Think about how Docker handles requests for images that do not exist.

security
expert
2:00remaining
Which IAM role is required to allow a user to push images to Google Container Registry?

You want to grant a user permission to push Docker images to GCR in your project. Which IAM role should you assign?

Aroles/container.admin
Broles/storage.objectAdmin
Croles/storage.objectViewer
Droles/container.developer
Attempts:
2 left
💡 Hint

Consider which role allows writing objects to the underlying storage bucket used by GCR.