By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: Farewell to Build Scripts as Docker Bake Goes GA
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > News > Farewell to Build Scripts as Docker Bake Goes GA
News

Farewell to Build Scripts as Docker Bake Goes GA

News Room
Last updated: 2025/02/24 at 8:23 AM
News Room Published 24 February 2025
Share
SHARE

Docker has announced the general availability of Docker Bake, a build orchestration tool designed to simplify complex Docker image builds. The Bake functionality has been in an experimental phase for several years, and it aims to address common challenges in managing Docker build configurations by declaratively defining build stages and deployment environments.

Docker Bake is part of the newly released Docker Desktop 4.38, and is also available in the Docker Buildx CLI Plugin. Docker Bake functions similarly to Docker Compose but focuses on build processes rather than runtime environments. It replaces traditional methods of managing multiple docker build commands requiring different flags and environment variables, often needing tedious repetition to build multiple images or images for various environments. Historically, these would usually have been shell scripts written ad-hoc by engineers. Now, with Docker Bake, engineers can write portable code using HCL, YAML or JSON to describe those flags and environment variables.

Docker Bake also introduces several key features aimed at improving build efficiency. These include automatically parallelising independent builds and eliminating redundant operations by deduplicating contexts and intelligent caching. These optimisations benefit teams working with monorepos or managing multiple related Docker images from a single source repository.

There have been a number of improvements to Docker Bake added in the run-up to general availability:

  • The deduplication of context transfers is a significant addition in the general availability release. Previously, when building targets concurrently, build contexts would load independently for each target, potentially leading to the same context being transferred multiple times. The new version automatically handles this deduplication, potentially reducing build times.
  • Security is also improved by introducing entitlements, which provide fine-grained control over builder capabilities and resource access during the build process. The system now includes specific flags for controlling access to host networking, sandbox environments, file systems, and SSH agents.
  • Docker Bake now supports composable attributes for configuration management, allowing engineers to define reusable attribute sets that can be combined and overridden across different targets. This is an improvement over the previous harder-to-use implementation, which used comma-separated values.
  • The release also introduces variable validation capabilities similar to those found in Terraform. This feature helps developers identify and resolve configuration errors early in the development process. Developers can now define multiple validation rules for variables and create dependencies between different variables.
  • Docker has added a new list option to improve usability that allows developers to quickly query available targets and variables in a Bake configuration. This information can be output in both standard and JSON formats for programmatic access.

The tool appears particularly valuable for organisations managing complex build configurations across multiple platforms and environments. It provides native compatibility with existing docker-compose.yml files, allowing teams to gradually adopt its advanced features while maintaining their current workflows.

Docker Bake also integrates with Docker Build Cloud, potentially enabling faster build times by parallelising matrix builds across cloud infrastructure. This capability could be particularly beneficial for remote teams and developers working with limited local computing resources.

In a blog post for Chainguard, Adrian Mouat provides a practical perspective on Docker Bake, highlighting its role as an alternative to managing Docker builds through shell scripts or Makefiles. Mouat demonstrates how a complex Docker build command can be transformed into a structured configuration file using HashiCorp Configuration Language (HCL), YAML, or JSON.


target "default" {
  tags = ["amouat/multi-plat-test"]
  platforms = [
    "linux/amd64",
    "linux/arm64",
  ]
  output = ["type=registry"]
  no-cache = true
  dockerfile = "cross.Dockerfile"
  context = "."
}

Mouat includes a detailed example of using Bake with Chainguard Images, showing how inheritance between build targets can reduce code duplication. For instance, a single configuration can define separate targets for development builds, multi-platform builds, and registry pushes, with each target inheriting and extending the properties of its predecessor.

“The most basic functionality of Docker Bake is to codify Docker builds, which can be done quickly and easily.”


– Adrian Mouat

Mouat continues by explaining how variables can be used to make configurations more flexible, such as changing registry destinations at runtime. He concludes that Bake is really useful in scenarios involving multi-stage builds and cross-platform development.

In a post on BlueSky, Mazlum Tosun from GroupBees shows his first experience with a Bake project.

“With Bake, the syntax become more easy and readable than classical Docker build commands”


– Mazlum Tosun

However, some commentators are critical of Docker’s claims of removing complexity of flags and environment variables by shifting these into HCL.

“as far as I can tell, all those flags and environment variables are still there, they’re just now defined even more verbosely in an HCL file…”


– Hacker News user lopkeny12ko

But others are already making significant gains, with user miiiiiike explaining how the new Bake contexts functionality has allowed him to retire a self-written tool to manage complex build dependencies:

“I’ve been playing with it for the past hour this morning. It looks like it does everything I want it to do and more.”


– Hacker News user miiiiiike

Organisations interested in implementing Docker Bake can access it by updating Docker Desktop to version 4.38, or by running the latest version of the Docker Buildx CLI plugin. Full documentation is available for teams looking to create their first Bake file and explore the tool’s capabilities.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Becoming Ransomware Ready: Why Continuous Validation Is Your Best Defense
Next Article RAD Security raises $14M to expand AI-driven cloud security platform – News
Leave a comment

Leave a Reply Cancel reply

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

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Amazon has the Samsung Galaxy Tab A9+ on sale for just under $200
News
Coinbase Agents Bribed, Data of ~1% Users Leaked; $20M Extortion Attempt Fails
Computing
What is CarPlay Ultra? Apple’s next-gen auto system explained
Gadget
Trump wants Apple to stop making more iPhones in India
News

You Might also Like

News

Amazon has the Samsung Galaxy Tab A9+ on sale for just under $200

2 Min Read
News

Trump wants Apple to stop making more iPhones in India

0 Min Read
News

Apple just gave us a big hint that the AirTag 2 will launch soon

3 Min Read
News

Marketplace Momentum: How Google Cloud is Rewiring the Economics of Enterprise Software

5 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?