BLACK FRIDAY SALE – Unlock Up to 25% OFF on All Exam Prep! - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Google Professional Cloud DevOps Engineer Exam - Topic 3 Question 113 Discussion

Posted by Laurel on Oct 14, 2026 at 11:56 PM

Your team has an application built by using a Dockerfile. The build is executed from Cloud Build, and the resulting artifacts are stored in Artifact Registry. Your team is reporting that builds are slow. You need to increase build speed, while following Google-recommended practices. What should you do?

Suggested Answer: A

To speed up Docker builds, optimize layer caching. Google Cloud recommends using --cache-from with Artifact Registry, and placing frequently changed files late in the Dockerfile so earlier layers can be reused.

''Put instructions that are less likely to change (like installing packages) early in the Dockerfile, and more frequently changing lines (like copying app code) near the end.''

--- Dockerfile Best Practices

''Use the --cache-from argument to pull layers from previously built images in Artifact Registry.''

--- Cloud Build Docker Caching

This dramatically reduces build time by avoiding redundant rebuilds of static layers.


Get Premium Professional Cloud DevOps Engineer Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
9 comments · newest first
DO
Dorthy 3 days ago
I’ve heard A is the way to go, but I’m curious about B too.
NI
Nieves 8 days ago
Caching to Cloud Storage? Seems like extra steps, not sure about that.
LA
Lamar 13 days ago
Wait, isn't it better to add modified files earlier? Sounds counterintuitive.
SA
Sabrina 18 days ago
Definitely agree with A, putting modified files later helps caching!
AM
Amalia 23 days ago
I think option A makes the most sense for build speed.
HI
Hillary 29 days ago
I’m leaning towards option B, but I’m not completely confident about whether the files should be in earlier or later stages.
HA
Haydee 1 month ago
I feel like adding frequently modified files to earlier stages makes sense for caching, but I can't remember if that's the best approach here.
HU
Hubert 1 month ago
I think we practiced a similar question where caching was involved, and I recall that using --cache-from with Artifact Registry was recommended.
SH
Sharen 1 month ago
I remember we discussed how the order of files in the Dockerfile can impact build speed, but I'm not sure if it should be earlier or later.
0/2000 characters

Save Cancel