On May 15, 2025, AWS announced a significant enhancement to its CodeBuild service: the Docker Server capability. This new feature allows developers to provision a dedicated and persistent Docker server within their CodeBuild projects, aiming to streamline and expedite the Docker image build process.
Traditionally, building Docker images in CI/CD pipelines can be time-consuming, especially when dealing with multi-layered images. With the Docker Server capability, AWS addresses this challenge by centralizing image building to a remote host. This approach reduces wait times and increases overall efficiency by maintaining a persistent Docker layer cache. In practical terms, AWS reports a dramatic reduction in build times when utilizing this feature.
The persistent Docker server supports multiple concurrent build operations, with all builds benefiting from the shared centralized cache. This setup not only accelerates the build process but also ensures consistency across builds, which is crucial for maintaining reliable deployment pipelines.
To leverage this capability, developers can enable the Docker Server option within their CodeBuild project settings. Once activated, CodeBuild provisions the dedicated Docker server with persistent storage, facilitating faster and more efficient builds.
To set up the new Docker Server capability in AWS CodeBuild (as detailed in the AWS blog), begin by creating a new CodeBuild project or editing an existing one in the AWS Management Console. In the environment configuration, select “Managed image” and choose Amazon Linux 2 as the operating system. Then, within the new Docker configuration section (available for supported standard images such as aws/codebuild/standard:7.0 or later), enable the “Docker Server mode” option. This activates a lightweight Docker daemon without the performance drawbacks typically associated with Docker-in-Docker (DinD). Next, update your buildspec.yml file to include Docker commands- for example, building and pushing images to Amazon ECR – just as you would in a local Docker setup.
The instructions remind you to make sure the IAM role used by CodeBuild has the necessary permissions to interact with services like Amazon ECR. Once everything is configured, you can then trigger your build.
The introduction of the Docker Server capability in AWS CodeBuild has sparked some discussion among developers and DevOps professionals. While there is appreciation for significantly reduced build times, there are currently limitations in integration with infrastructure-as-code tools.
For instance, a GitHub issue in the AWS Cloud Development Kit (CDK) repository highlights that:
“As of now, the AWS CDK does not support this capability because CloudFormation also does not expose it yet. CDK can only provide support once CloudFormation does.”
This suggests that while the feature is promising, its adoption may be hindered until full support is available in tools such as CloudFormation and CDK.
Despite these integration challenges, the Docker Server capability has been lauded for its performance improvements. In the official AWS blog post, Donnie Prakoso shared benchmark results demonstrating a 98% reduction in build time, from nearly 25 minutes down to just 16 seconds, when utilizing this feature.
This new feature competes with existing solutions, such as Docker Inc’s Docker Build Cloud, GCP’s Cloud Build, and GitHub Actions Docker Layering.
This enhancement to AWS CodeBuild underscores AWS’s commitment to improving developer productivity and optimizing the CI/CD workflow. By reducing build times and streamlining the image creation process, the Docker Server capability enables development teams to deploy applications more rapidly and reliably.