Skip to content

BuildKit LLB Generation

Railpack takes the build plan and generates a BuildKit LLB definition using the LLB Go API. The LLB is then either sent to the BuildKit daemon or used by a custom frontend.

Generating LLB directly instead of transpiling the plan into a Dockerfile has several advantages:

  1. Custom Frontend Integration: Direct LLB generation enables integration with BuildKit’s frontend gateway. This allows the platform to either use BuildKit through Docker or by interacting with the BuildKit daemon directly.

  2. Caching and Optimization: Direct LLB generation enables fine-grained control over the build cache, allowing more complex caching than what’s possible with Dockerfile generation.

  3. Secret Management: LLB provides more secure and flexible secret mounting.

  4. Type Safety and Compile-Time Validation: The build defintion is checked at compile-time using the first party Go library.