Google Cloud Professional Cloud Developer — Question 148

You are configuring a continuous integration pipeline using Cloud Build to automate the deployment of new container images to Google Kubernetes Engine (GKE). The pipeline builds the application from its source code, runs unit and integration tests in separate steps, and pushes the container to Container Registry. The application runs on a Python web server.

The Dockerfile is as follows:

FROM python:3.7-alpine -

COPY . /app -

WORKDIR /app -
RUN pip install -r requirements.txt
CMD [ "gunicorn", "-w 4", "main:app" ]

You notice that Cloud Build runs are taking longer than expected to complete. You want to decrease the build time. What should you do? (Choose two.)

Answer options

Correct answer: A, C

Explanation

Selecting a VM size with higher CPU (Option A) can improve build times by providing more processing power. Caching the Docker image (Option C) allows subsequent builds to reuse layers, significantly speeding up the build process. The other options either do not optimize build time effectively or introduce unnecessary complexity.