Cloud Technology Community Question

How can I reduce build times in my CI/CD pipeline when using devops best practices?

Posted on 2025-03-14 • In Cloud Technology • By Gregory Nelson

Our team is currently struggling with 45-minute deployment cycles. We are trying to implement <devops> to speed things up, but our Jenkins builds are lagging during the containerization phase. Is it better to use a distributed build architecture with Kubernetes agents, or should we focus on optimizing our Docker layer caching to see immediate improvements in our velocity?

3 Answers 12,482 Views

All answers to this question 3 Answers

Carol Martinez Answered on 2025-03-16
Answered

Reducing build latency is a core pillar of a mature <devops> culture. You should first analyze your Dockerfile structure; ensuring that the least frequently changed layers are at the top will maximize cache hits. Beyond that, moving to ephemeral Kubernetes agents for your Jenkins builds allows for parallel processing which can drastically cut down the time spent in the queue. We implemented a shared persistent volume for the package manager's cache (like npm or maven), and it shaved 15 minutes off our total build time. Also, consider "Shallow Clones" in Git to avoid downloading the entire history if you only need the latest commit for the build process.

Jeffrey Hall Answered on 2025-03-18
Answered

Are you currently monitoring your resource utilization during the build, or are you just assuming the <devops> pipeline configuration is the main culprit for the delay?

Raymond Scott Commented on 2025-03-19
Commented

Jeffrey, we did a quick check on the node metrics and realized we are hitting CPU throttles during the unit testing phase. Do you think increasing the instance size is a sustainable fix, or should we be looking into test splitting to run them across multiple smaller containers instead? I'm worried about the cost implications of just throwing bigger hardware at the problem without fixing the underlying efficiency.

Brenda Allen Answered on 2025-03-21
Answered

In our <devops> workflow, we switched to Kaniko for building container images inside Kubernetes. It handles caching much better in a daemon-less environment.

Gregory Nelson Commented on 2025-03-22
Commented

I agree with Brenda. Kaniko was a lifesaver for our security team too, since it doesn't require privileged access to the Docker daemon.

Write a Comment

Your email address will not be published. Required fields are marked (*)

Join the LearnersEra Community

Ask questions, share knowledge and learn from professionals across technology, project management and certification topics.

Change Country and Nearest City

Select your country and nearest city to see courses available in your region.