build-push-action: Docker image building with Buildx
GitHub Action for building and publishing Docker images.
Learn more about build-push-action
build-push-action is a GitHub Action that orchestrates Docker image construction and registry publishing through Buildx, which wraps the Moby BuildKit builder toolkit. The action integrates with GitHub's workflow system to execute container builds with access to BuildKit's advanced features including multi-architecture compilation, remote cache backends, and secret injection. It operates by translating workflow inputs into Buildx commands, supporting both Git-based context (where BuildKit clones the repository directly) and local filesystem context (when used with actions/checkout). Common deployment scenarios include CI/CD pipelines that build images on push events, pull request validation, and scheduled builds for multi-platform distribution across architectures like amd64, arm64, and others.
BuildKit integration
Provides direct access to Moby BuildKit capabilities including advanced caching, secrets handling, and build arguments without requiring manual BuildKit configuration. The action abstracts BuildKit complexity while exposing its full feature set.
Git context support
By default uses Git references as build context, allowing BuildKit to clone and build directly from repository state without requiring a separate checkout step. Supports Handlebars templating for context path specification.
Multi-platform builds
Works with setup-qemu-action and setup-buildx-action to enable cross-architecture compilation in a single workflow, producing images for multiple platforms like amd64, arm64, and others simultaneously.
name: Build and Push
on:
push:
branches: [main]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/build-push-action@v5
with:
context: .
push: true
tags: user/app:latestAdds Docker Build Cloud support for build summaries; updates actions-toolkit dependency to 0.62.1.
- –Enable build summary reporting when using Docker Build Cloud by upgrading to this release.
- –Review actions-toolkit changelog for dependency changes introduced in the 0.61.0 to 0.62.1 bump.
Build records now export via `buildx history export` instead of the legacy export-build tool.
- –Update workflows if you parse build record output; the export format may differ from the old tool.
- –No action required for standard usage; the change is internal to the actions-toolkit dependency.
Maintenance release improving secret handling in build summaries and fixing attestation environment variable behavior.
- –Build summary output now masks secret values and prints only their keys to prevent credential leakage in logs.
- –Action correctly handles missing default attestations environment variable instead of failing or misinterpreting it.
See how people are using build-push-action
Top in Cloud & DevOps
Related Repositories
Discover similar tools and frameworks used by developers
configure-aws-credentials
GitHub Action for AWS credential resolution in workflows.
setup-node
Node.js version management and dependency caching for workflows.
compose
YAML-defined container lifecycle management and orchestration tool.
portainer
Web-based management platform for multi-orchestrator container environments.
OpenZFS
Production-ready, enterprise-grade filesystem combining volume management, data integrity protection, snapshots, and compression for Linux, FreeBSD, and illumos systems.