Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(chore) #485: Implement Multi-Architecture Docker Image Build and Deployment with Debian Base Image #517

Closed
wants to merge 93 commits into from

Conversation

Bcoderx6
Copy link

@Bcoderx6 Bcoderx6 commented Jul 23, 2024

#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

  • 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.
    • Docker Buildx Configuration: Configured docker/setup-buildx-action@v2 to manage Buildx instances, facilitating multi-architecture image builds.
    • 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.

@viferga @giarve

@Bcoderx6 Bcoderx6 changed the title (chore) Implement Multi-Architecture Docker Image Build and Deployment with Debian Base Image (chore) #485: Implement Multi-Architecture Docker Image Build and Deployment with Debian Base Image Jul 23, 2024
@viferga
Copy link
Member

viferga commented Aug 13, 2024

I made a base version: https://github.com/metacall/core/actions/runs/10378538484

@viferga viferga closed this Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants