Docker build cache sharing on multi-hosts with BuildKit and buildx

Jiang Huan
Titansoft Engineering Blog
7 min readJul 10, 2019

--

To share how BuildKit is used along with buildx to speed up our image build jobs on multiple hosts such as shared Gitlab CI runners.

At the time of writing, we are using the pre-release version of docker community edition 19.03, with BuildKit support and buildx release v0.2.2.

Photo by chuttersnap on Unsplash

Currently in Titansoft, we are on a journey of infrastructure transformation with Docker and Kubernetes. We believe adopting Kubernetes will benefit our customers with better time-to-market, reduced infrastructure up-front cost, and more efficient resource utilisation.

To support this infrastructure transformation across product teams, we have created standardised CI pipelines with Gitlab CI to build, test and deploy our containerized applications.

We have found the default builders to be difficult to use, and in this article, we will focus on how the BuildKit build cache export/import feature helps us in speeding up image build jobs across multiple hosts.

Why does the default build cache not work for us?

--

--