Add Workflow for Multi-Architecture Docker Image Build, Push, and Manifest Management #535
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a comprehensive GitHub Actions workflow to build, push, and manage Docker images for multiple architectures, ensuring broad platform support and seamless integration. Key features include:
Trigger Conditions:
Executes on push and pull_request events for branches (master, develop, and feature/**) and tags matching the pattern v*...
Implements concurrency to prevent overlapping runs for the same workflow or pull request.
Workflow Steps:
Build Stage:
Leverages QEMU and BuildX to enable cross-platform builds.
Constructs Docker images for eight platforms, including linux/amd64, linux/arm64, and others.
Tags images with platform-specific suffixes.
Push Stage:
Pushes the platform-specific images to Docker Hub.
Manifest Management:
Creates and pushes multi-architecture manifest lists for key tags (deps, dev, runtime, cli).
Includes support for version-specific tags derived from GitHub tag references.
Maintains a latest tag pointing to the CLI image.
Testing Stage:
Validates the CLI image by creating a test Dockerfile that runs a basic script using metacallcli.
Tests across all supported architectures.
Cleanup Stage:
Removes platform-specific tags from Docker Hub after manifest creation to minimize clutter.
Environment Variables:
Centralizes key variables like Docker registry, username, image name, and BuildKit version for easier management.
Secrets Management:
Securely uses DOCKER_HUB_USERNAME and DOCKER_HUB_ACCESS_TOKEN for authentication.
Notes:
This workflow ensures compatibility across a wide range of platforms, facilitates efficient Docker image management, and automates testing and cleanup. It lays the foundation for scalable and robust multi-architecture Docker builds.
@viferga