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

10 commits

Author SHA1 Message Date
Jason Hall
9dc786c3f1
feat: replace vendor/oci-distribution with direct OCI Distribution Spec implementation
Replace the vendor/oci-distribution dependency with a custom implementation
that directly follows the OCI Distribution Specification using hyper for HTTP.

Key improvements:
- Direct HTTP implementation using hyper, hyper-util, and hyper-tls
- Support for Bearer token, Basic auth, and Anonymous authentication
- Cross-registry blob copying for layered images
- Multi-platform manifest list support
- Better error handling and redirect support
- Reduced dependency footprint

Technical changes:
- Remove vendor/oci-distribution dependency
- Add hyper ecosystem dependencies for HTTP client
- Implement OCI types: OciDescriptor, OciImageManifest, OciImageIndex
- Add ImageReference parsing with registry/repository/tag/digest support
- Implement registry authentication flows (Bearer token requests)
- Add blob upload/download with redirect handling
- Support manifest pulling with image index resolution
- Fix manifest size validation for Docker compatibility
- Update integration tests to use new registry auth types
- Handle docker.io redirect to registry-1.docker.io correctly

This enables more flexible authentication handling and reduces external
dependencies while maintaining full OCI compliance.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 22:25:10 -04:00
Jason Hall
a6ae83c3b2
feat: Add credential helper support to oci-distribution
- Move Docker config parsing and credential helper execution from krust
- Add automatic auth resolution methods (*_auto) to the client
- Support standard Docker config locations and environment variables
- Add comprehensive tests and examples
- Simplify krust to use the new credential helper functionality
2025-06-08 10:30:41 -04:00
Jason Hall
7827c25d9b
feat: Fork oci-distribution and add enhanced features
- Fork oci-distribution v0.11.0 into vendor/oci-distribution
- Add get_image_platforms() method for proper platform detection
- Support fetching config blobs for single-platform images
- Add OAuth2/Bearer token authentication support
- Add push_manifest_and_get_digest() for reliable digest extraction
- Update krust to use the forked version with enhanced features
2025-06-08 09:49:41 -04:00
Jason Hall
b6b0c71d0c
feat: Implement registry authentication support
This implements authentication for container registries, porting
functionality from go-containerregistry's authn package to Rust.

Key features:
- AuthConfig struct for various auth types (basic, bearer, anonymous)
- Authenticator trait for pluggable auth providers
- DefaultKeychain that reads Docker config files from standard locations
- Support for credential helpers (docker-credential-*)
- Integration with oci-distribution for registry operations

The implementation checks for credentials in this order:
1. DOCKER_CONFIG environment variable
2. REGISTRY_AUTH_FILE environment variable
3. XDG_RUNTIME_DIR/containers/auth.json
4. HOME/.docker/config.json

Credential helpers are supported if configured in the Docker config.

This enables krust to:
- Pull private base images
- Push to authenticated registries
- Support various auth methods (basic, token, oauth2)

Closes #2

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 09:19:04 -04:00
Jason Hall
4522e79c81
Merge pull request #8 from imjasonh/dependabot/cargo/dirs-6.0 2025-06-08 01:10:20 -04:00
dependabot[bot]
fcb4ef15f8
chore(deps): Update which requirement from 6.0 to 8.0
Updates the requirements on [which](https://github.com/harryfei/which-rs) to permit the latest version.
- [Release notes](https://github.com/harryfei/which-rs/releases)
- [Changelog](https://github.com/harryfei/which-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/harryfei/which-rs/compare/6.0.0...8.0.0)

---
updated-dependencies:
- dependency-name: which
  dependency-version: 8.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-08 05:03:46 +00:00
dependabot[bot]
a97ceda0ee
chore(deps): Update dirs requirement from 5.0 to 6.0
---
updated-dependencies:
- dependency-name: dirs
  dependency-version: 6.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-08 05:03:35 +00:00
Jason Hall
d4b7b216df
Fix flaky tests with temp directories and update documentation
This commit eliminates test flakiness by building to unique temporary
directories and updates the README to reflect all changes in this branch.

Code changes:
- Modified RustBuilder to use tempfile::tempdir() for each build
- Added BuildResult struct to keep temp directory alive during image build
- Each build now gets its own isolated target directory
- Removed clean_example_dir() and all cleanup logic - no longer needed
- Tests can now run concurrently without interfering with each other

Documentation updates:
- Added "Isolated builds" and "Concurrent builds" to key features
- Added comprehensive "Build Process" section explaining the temp directory approach
- Updated multi-arch documentation to reflect default behavior (builds both platforms)
- Added "Multi-Architecture Images" section explaining how multi-arch works
- Documented that manifest list support is planned for future release

Benefits:
- No more "Built binary not found" errors
- Tests run reliably every time
- Concurrent test execution is now safe
- Simpler test code without cleanup logic
- Clear documentation of build isolation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 23:13:45 -04:00
Jason Hall
642472c548
Ensure all tests run on all platforms without skipping
- Remove test skipping based on target availability
- Install cross-compilation toolchains for all platforms in CI:
  - Ubuntu: musl-tools
  - macOS: musl-cross with proper cargo config
  - Windows: rust-lld linker
- Update builder to use platform-appropriate linkers
- Make full build/run workflow test mandatory in CI
- Add Docker setup and local registry for integration tests
- Set RUSTFLAGS with --cfg ci to enable CI-specific test behavior

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 21:17:30 -04:00
Jason Hall
5e89023925
Initial commit: krust - container image build tool for Rust
krust builds container images for Rust applications without Docker:
- Builds static binaries using musl libc
- Creates minimal OCI container images
- Pushes to any OCI-compliant registry
- Outputs digest to stdout for composability

Inspired by ko.build for Go applications.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 20:46:08 -04:00