Is building Docker images taking too long for you?

We use Github Actions for our CI/CD platform and I have been working recently on improving the speed of the build jobs. Prior to the improvements we were using public Github hosted Actions runners and build times alone would range from 50-75 mins, with the average being close to 58 minutes. Deployments would take another 20-25 minutes. For us there were great performance gains in moving to using self hosted runners vs the Github hosted runners.

Without any other changes our build time went from the 50-75 min range to a consistent 16-17 minutes. Deployment times didn’t improve much but improve some. A few minutes were shaved off. Since we are using Github Actions we setup the build workflows to use the Github Action caching backend. When this was tested then build time took about 20-21 minutes but it was cached. If we ran the same build job again, the build time was reduced to 2 minutes.

If any of you are using publicly hosted Github Actions runners, and feel like builds are slow, have a look at hosting the runners yourself. Our Kubernetes nodes are running on AWS r6a.large instance sizes.

https://docs.docker.com/build/cache/backends/gha/

1 Like