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:
parent
11083dc527
commit
6153452303
8 changed files with 260 additions and 37 deletions
18
README.md
18
README.md
|
|
@ -100,8 +100,14 @@ krust build example/hello-krust --no-push
|
|||
# Use a specific image name (overrides KRUST_REPO)
|
||||
krust build --image myregistry.io/myapp:v1.0
|
||||
|
||||
# Build for a different platform
|
||||
# Build for a specific platform
|
||||
krust build --platform linux/arm64
|
||||
|
||||
# Build for multiple platforms (multi-arch)
|
||||
krust build --platform linux/amd64,linux/arm64
|
||||
|
||||
# Or specify platforms separately
|
||||
krust build --platform linux/amd64 --platform linux/arm64
|
||||
```
|
||||
|
||||
### Build with custom cargo arguments
|
||||
|
|
@ -185,6 +191,7 @@ When determining the base image, krust uses this precedence order:
|
|||
- **Docker-free** - Builds OCI container images without requiring Docker daemon
|
||||
- **Static binaries** - Produces truly static binaries using musl libc
|
||||
- **Composable** - Outputs image digest to stdout, enabling `docker run $(krust build)`
|
||||
- **Multi-arch support** - Build for multiple platforms in a single command
|
||||
- **Cross-platform** - Supports multiple architectures (amd64, arm64, arm/v7)
|
||||
- **Minimal images** - Uses distroless base images for security and size
|
||||
- **OCI compliant** - Works with any OCI-compliant container registry
|
||||
|
|
@ -260,6 +267,15 @@ This is normal when building linux/amd64 images on Apple Silicon. The images wil
|
|||
git clone https://github.com/imjasonh/krust.git
|
||||
cd krust
|
||||
|
||||
# Install cross-compilation toolchain (required for tests)
|
||||
# On macOS:
|
||||
brew install messense/macos-cross-toolchains/x86_64-unknown-linux-musl
|
||||
brew install messense/macos-cross-toolchains/aarch64-unknown-linux-musl
|
||||
|
||||
# Install Rust targets
|
||||
rustup target add x86_64-unknown-linux-musl
|
||||
rustup target add aarch64-unknown-linux-musl # Optional, for ARM64 support
|
||||
|
||||
# Install pre-commit hooks
|
||||
pip install pre-commit
|
||||
or
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue