This pull request introduces comprehensive enhancements to the Docker build and deployment process, focusing on multi-architecture support and optimized base images. The following key updates have been made:
Docker Compose Updates
Platform Specification: Modified docker-compose-multiarch.yml to include the platform directive for each service, targeting architectures such as linux/amd64 and linux/arm64. This change ensures compatibility with different hardware configurations.
Shell Script Enhancements
Updated docker-compose.sh:
Multi-Architecture Builds: Enhanced the sub_build_multiarch() function to leverage Docker Buildx for building images across multiple architectures.
Base Image Specification: Utilized METACALL_BASE_IMAGE=debian:bookworm-slim to standardize the base image for all services, ensuring a consistent and optimized environment for building Docker images.
GitHub Actions Workflow
Multi-Platform Build Support:
QEMU Setup: Integrated docker/setup-qemu-action@v2 for cross-platform emulation, allowing builds for architectures not natively supported by the host machine.
Build Matrix Strategy: Established a matrix to build images for linux/amd64, linux/arm/v6, linux/arm/v7, and linux/arm64, extending compatibility across diverse platforms.
-Metadata and Versioning:
Image Metadata: Used docker/metadata-action@v5 to automatically handle Docker image tags and versions.
Manifest List Creation: Created and pushed a manifest list to consolidate architecture-specific images under a single Docker tag, simplifying distribution and deployment.
Benefits
Enhanced Compatibility: Support for multiple architectures, including ARM-based systems like Apple's M1, broadens the usability of Docker images.
Consistent Base Image: Utilizing debian:bookworm-slim as the base image ensures a streamlined and efficient build environment across all services.
Efficient Build Process: Optimized build contexts and automated metadata handling improve the overall build efficiency and management.
https://github.com/metacall/core/issues/485
This pull request introduces comprehensive enhancements to the Docker build and deployment process, focusing on multi-architecture support and optimized base images. The following key updates have been made:
Docker Compose Updates
docker-compose-multiarch.yml
to include theplatform
directive for each service, targeting architectures such aslinux/amd64
andlinux/arm64
. This change ensures compatibility with different hardware configurations.Shell Script Enhancements
docker-compose.sh
:sub_build_multiarch()
function to leverage Docker Buildx for building images across multiple architectures.METACALL_BASE_IMAGE=debian:bookworm-slim
to standardize the base image for all services, ensuring a consistent and optimized environment for building Docker images.GitHub Actions Workflow
docker/setup-qemu-action@v2
for cross-platform emulation, allowing builds for architectures not natively supported by the host machine.docker/setup-buildx-action@v2
to manage Buildx instances, facilitating multi-architecture image builds.linux/amd64
,linux/arm/v6
,linux/arm/v7
, andlinux/arm64
, extending compatibility across diverse platforms.-Metadata and Versioning:
docker/metadata-action@v5
to automatically handle Docker image tags and versions.Benefits
debian:bookworm-slim
as the base image ensures a streamlined and efficient build environment across all services.@viferga @giarve