You are deploying a Python application to Cloud Run using Cloud Source Repositories and Cloud Build. The Cloud Build pipeline is shown below:
steps:
- name: python
entrypoint: pip
args: ["install","-r","requirements.txt","--user"]
- name: "gcr.io/cloud-builders/docker"
args: ["build", "-t", "us-central1-docker.pkg.dev/${PROJECT_ID}/${_REPO_NAME}/myimage:${SHORT_SHA}", "."]
- name: "gcr.io/cloud-builders/docker"
args: ["push", "us-central1-docker.pkg.dev/${PROJECT_ID}/${_REPO_NAME}/myimage:${SHORT_SHA}"]
- name: google/cloud-sdk
args: ["gcloud", "run", "deploy", "helloworld-${SHORT_SHA}", "--region", "us-central1", "--platform", "managed", "--allowed-unauthenticated"]
You want to optimize deployment times and avoid unnecessary steps. What should you do?
A. Remove the step that pushes the container to Artifact Registry.
B. Deploy a new Docker registry in a VPC, and use Cloud Build worker pools inside the VPC to run the build pipeline.
C. Store image artifacts in a Cloud Storage bucket in the same region as the Cloud Run instance.
D. Add the –cache-from argument to the Docker build step in your build config file.
Answer
D