1
0
Fork 0
mirror of https://github.com/imjasonh/krust synced 2026-07-08 06:45:32 +00:00

feat: Add multi-arch support

- Support building for multiple platforms with --platform flag
- Accept comma-separated platforms or multiple --platform flags
- Default to building for linux/amd64 and linux/arm64
- Add ARM runner (ubuntu-24.04-arm) to CI matrix
- Create manifest list for multi-arch images (TODO: push to registry)
- Update integration tests to handle multi-platform builds
- Add cross-compilation setup instructions to README
- Add .cargo/config.toml for local development

Breaking changes:
- Default behavior now builds for multiple platforms (amd64+arm64)
- Use --platform linux/amd64 to build for single platform
This commit is contained in:
Jason Hall 2025-06-07 22:28:15 -04:00
parent 11083dc527
commit 6153452303
Failed to extract signature
8 changed files with 260 additions and 37 deletions

View file

@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, ubuntu-24.04-arm]
rust: [stable, beta]
steps:
- uses: actions/checkout@v4
@ -24,12 +24,17 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: x86_64-unknown-linux-musl
- name: Install cross-compilation tools (Ubuntu)
targets: x86_64-unknown-linux-musl,aarch64-unknown-linux-musl
- name: Install cross-compilation tools (Ubuntu x64)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
sudo apt-get install -y musl-tools gcc-aarch64-linux-gnu
- name: Install cross-compilation tools (Ubuntu ARM)
if: matrix.os == 'ubuntu-24.04-arm'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools gcc-x86-64-linux-gnu
- name: Cache cargo registry
uses: actions/cache@v4
with:
@ -105,11 +110,11 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-musl
targets: x86_64-unknown-linux-musl,aarch64-unknown-linux-musl
- name: Install musl tools
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
sudo apt-get install -y musl-tools gcc-aarch64-linux-gnu
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build krust
@ -136,6 +141,10 @@ jobs:
run: |
cd example/hello-krust
krust build --no-push --image local.test/hello:latest ./
- name: Test multi-arch build
run: |
cd example/hello-krust
krust build --no-push --platform linux/amd64,linux/arm64 --image local.test/multiarch:latest ./
# Takes too long to run on CI, so it's commented out for now.
# coverage: