Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

chore(ci): speed up docker-build workflow #803

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sljeff
Copy link

@sljeff sljeff commented May 7, 2024

Close #796 after merge @davidtaikocha @mask-pp

Results

A complete build and push operation took only 2m18s. And there are Docker images

(It took more than 17 minutes before this PR)

image

Changes

Optimizations:

  1. Added build cache and mod cache, which can reduce the compilation time by approximately three minutes.
    • Utilized actions/cache@v3.
  2. Switched to cross-compilation on the actions runner, avoiding the use of qemu in containers, thus reducing at least 10 minutes of compilation time for the arm64 version.
    • Added build-arm in the Makefile.
    • Before executing build-arm in the build-binary job, it's necessary to install dependencies for cross-compilation.

Other Changes:

  1. Following Docker's official documentation to merge multi-platform builds into a single image, automatically differentiating between platforms. Docker Multi-Platform Build Documentation
  2. Added a ci.dockerfile specifically for adding binary files.

Details

  1. The first binary compilation took 4m, and subsequent compilations took just over a minute.
  2. The compiled image supports two architectures: Docker image
  3. Both arm64 and amd64 binaries run smoothly.
image image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore(ci): speed up docker-build workflow
1 participant