---
title: "Accelerate Your Docker Builds Using AWS CodeBuild and Docker Build Cloud"
description: "Offloading container image builds from AWS CodeBuild to Docker Build Cloud addresses three common CI bottlenecks: undersized build machines, no persistent layer cache in clean CI environments, and slow emulated multi-architecture builds."
url: "https://swe.quest/articles/accelerate-your-docker-builds-using-aws-codebuild-and-docker-build-cloud-cf566617782de575"
canonical: "https://www.docker.com/blog/accelerate-your-docker-builds-using-aws-codebuild-and-docker-build-cloud/"
source: "Docker"
published: "2024-12-18"
difficulty: "medium"
kind: "How-to"
reading_minutes: 8
tags: ["ci-cd","containers","build-systems","cloud"]
---

# Accelerate Your Docker Builds Using AWS CodeBuild and Docker Build Cloud

A post on [Docker](https://swe.quest/sources/docker.md), published 2024-12-18, 8 min read, How-to. Original: [https://www.docker.com/blog/accelerate-your-docker-builds-using-aws-codebuild-and-docker-build-cloud/](https://www.docker.com/blog/accelerate-your-docker-builds-using-aws-codebuild-and-docker-build-cloud/)

## Summary

Offloading container image builds from AWS CodeBuild to Docker Build Cloud addresses three common CI bottlenecks: undersized build machines, no persistent layer cache in clean CI environments, and slow emulated multi-architecture builds. A buildspec.yml installs the latest Buildx, logs in to ECR and Docker with a PAT from Secrets Manager, selects a cloud builder, and runs \`docker buildx build --platform linux/amd64,linux/arm64 --push\` straight to ECR. On a 2 vCPU/3GB CodeBuild instance, the build dropped from 5:59 for an AMD64-only local build to 1:04 for a native AMD64+Arm64 build, using 16 vCPU/32GB builders and a 200 GiB shared cache.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)
- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)

## Prerequisites

- Docker image builds ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- AWS CodeBuild buildspec ([easy posts on Cloud platforms](https://swe.quest/tags/cloud.md?difficulty=easy))
- Amazon ECR

## Keywords

Docker Build Cloud, AWS CodeBuild, Docker Buildx, Amazon ECR, AWS Secrets Manager, AWS Graviton

## Related posts

- [Powered by Docker: Streamlining Engineering Operations as a Platform Engineer](https://swe.quest/articles/powered-by-docker-streamlining-engineering-operations-as-a-platform-engineer-f63ffa3b322e1c4b.md): Docker · 2025-02-18 · Medium · 7 min read · CI/CD, Containers, Observability, Deployment, Infrastructure as code
  Replacing QEMU-emulated multi-architecture Docker Buildx builds with native arm64 and amd64 self-hosted GitHub Actions runners cut build times by roughly 90%, with the multi-arch manifest published after the native builds finish.
- [Deploying to production in \<5m with our hosted container builder](https://swe.quest/articles/deploying-to-production-in-5m-with-our-hosted-container-builder-ca80279668d29e71.md): incident.io · 2021-11-18 · Medium · 9 min read · CI/CD, Containers, Build systems, Developer productivity, Caching
  incident.io cut Docker image build times from an inconsistent 3–10+ minutes back to under 2 minutes by replacing CircleCI's remote Docker and Docker Layer Caching with a permanently running GCP c2-standard-8 builder with a 500GB SSD.
- [Why Testcontainers Cloud Is a Game-Changer Compared to Docker-in-Docker for Testing Scenarios](https://swe.quest/articles/why-testcontainers-cloud-is-a-game-changer-compared-to-docker-in-docker-for-206c0ecf09c497e2.md): Docker · 2024-11-14 · Medium · 8 min read · Testing, CI/CD, Containers
  Docker-in-Docker, commonly used to give CI jobs a Docker daemon for Testcontainers integration tests, requires privileged mode and nests storage drivers, cgroups and namespaces, which leads to security audit problems, flaky builds, slow pipelines and hard debugging.
- [Optimizing Our E2E Pipeline](https://swe.quest/articles/optimizing-our-e2e-pipeline-880da9c129e2726b.md): Slack Engineering · 2025-04-14 · Medium · 5 min read · CI/CD, Build systems, Testing, Developer productivity, Cost optimization
  Slack cut redundant frontend builds in its monorepo E2E pipeline by using \`git diff\` three-dot notation against \`main\` to detect whether a PR touches frontend code, and when it doesn't, serving a recent production frontend build from S3 through an internal CDN instead of rebuilding.
- [Counting to 3 with a new builder processing 50M+ monthly builds](https://swe.quest/articles/counting-to-3-with-a-new-builder-processing-50m-monthly-builds-47ae6a690cb417f7.md): Railway · 2026-05-14 · Medium · 8 min read · CI/CD, Virtualization, Build systems, Scaling, Linux
  Railway replaced its docker-buildx-on-GCP-VMs build system with Builder v3: 256-vCPU bare-metal hosts split into eight 32-vCPU microVM build cells running buildkitd, scheduled with a 1-of-3 ring to keep BuildKit caches warm, now peaking at 66,000 builds per hour.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
