mirror of
https://github.com/imjasonh/krust
synced 2026-07-07 22:35:25 +00:00
commit
4112c0af37
3 changed files with 17 additions and 26 deletions
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
|
|
@ -14,6 +14,7 @@ jobs:
|
|||
name: Test
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, ubuntu-24.04-arm]
|
||||
rust: [stable, beta]
|
||||
|
|
@ -57,12 +58,10 @@ jobs:
|
|||
- run: make verify-cross-compile
|
||||
- run: make build
|
||||
- run: make test
|
||||
- run: make test-e2e
|
||||
# Only run cross-compilation integration test on x86_64 runners
|
||||
- name: Run integration test (cross-compilation)
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: make run-built-image
|
||||
|
||||
- run: make run-built-image
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
|
||||
fmt:
|
||||
name: Rustfmt
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
8
Makefile
8
Makefile
|
|
@ -98,13 +98,9 @@ check: check-fmt lint test
|
|||
|
||||
push-ttl:
|
||||
@echo "Pushing to ttl.sh..."
|
||||
KRUST_REPO=ttl.sh/jason cargo run build ./example/hello-krust
|
||||
|
||||
push-gar:
|
||||
@echo "Pushing to gar.sh..."
|
||||
KRUST_REPO=us-central1-docker.pkg.dev/jason-chainguard/krust cargo run build ./example/hello-krust
|
||||
KRUST_REPO=ttl.sh/krust cargo run build ./example/hello-krust
|
||||
|
||||
run-built-image:
|
||||
@image=$$(KRUST_REPO=ttl.sh/jason cargo run build ./example/hello-krust) && \
|
||||
@image=$$(KRUST_REPO=ttl.sh/krust cargo run build ./example/hello-krust) && \
|
||||
echo "Running image: $$image" && \
|
||||
docker run --rm $$image
|
||||
|
|
|
|||
26
README.md
26
README.md
|
|
@ -19,7 +19,7 @@ krust builds container images for Rust applications without requiring Docker. It
|
|||
cargo install --path .
|
||||
|
||||
# Set up your repository
|
||||
export KRUST_REPO=ttl.sh/$USER
|
||||
export KRUST_REPO=<repository-to-push-to>
|
||||
|
||||
# Build and run your Rust app as a container
|
||||
docker run $(krust build)
|
||||
|
|
@ -90,7 +90,7 @@ krust outputs the pushed image reference by digest to stdout, with all other out
|
|||
|
||||
```bash
|
||||
# Set your repository prefix
|
||||
export KRUST_REPO=ttl.sh/jason
|
||||
export KRUST_REPO=<repository-to-push-to>
|
||||
|
||||
# Build and push (default behavior)
|
||||
krust build
|
||||
|
|
@ -214,8 +214,7 @@ The tradeoff is that musl has slightly different behavior than glibc in some edg
|
|||
|
||||
## Environment Variables
|
||||
|
||||
- `KRUST_REPO` - Default repository prefix for built images (e.g., `ttl.sh/username`)
|
||||
- `KRUST_IMAGE` - Override the full image reference for a build
|
||||
- `KRUST_REPO` - Default repository prefix for built images
|
||||
|
||||
## Configuration
|
||||
|
||||
|
|
@ -311,8 +310,8 @@ Example Docker config with various auth methods:
|
|||
Build and run the example application:
|
||||
|
||||
```bash
|
||||
# Set your repository (ttl.sh provides temporary anonymous storage)
|
||||
export KRUST_REPO=ttl.sh/jason
|
||||
# Set your repository
|
||||
export KRUST_REPO=<repository-to-push-to>
|
||||
|
||||
# Build and push the example (default behavior)
|
||||
krust build example/hello-krust
|
||||
|
|
@ -321,15 +320,12 @@ krust build example/hello-krust
|
|||
krust build example/hello-krust --no-push
|
||||
|
||||
# Build, push, and run the example
|
||||
docker run $(krust build example/hello-krust)
|
||||
docker run --rm $(krust build example/hello-krust)
|
||||
|
||||
# Or specify a custom image name with TTL (time-to-live)
|
||||
# Images on ttl.sh expire based on the tag: 1h, 2d, 1w, etc.
|
||||
krust build example/hello-krust --image ttl.sh/jason/hello:1h
|
||||
# Specify a tag to apply to the image
|
||||
krust build example/hello-krust --tag v1.2.3
|
||||
```
|
||||
|
||||
Note: [ttl.sh](https://ttl.sh) is a free, temporary container registry perfect for testing. Images are automatically deleted after their TTL expires.
|
||||
|
||||
## CLI Reference
|
||||
|
||||
### Build Command
|
||||
|
|
@ -373,7 +369,7 @@ Options:
|
|||
|
||||
```bash
|
||||
# Resolve a single file
|
||||
export KRUST_REPO=ttl.sh/myuser
|
||||
export KRUST_REPO=<repository-to-push-to>
|
||||
krust resolve -f deployment.yaml > resolved.yaml
|
||||
|
||||
# Resolve multiple files
|
||||
|
|
@ -410,7 +406,7 @@ The `resolve` command will:
|
|||
1. Find all `krust://` references (deduplicates automatically)
|
||||
2. Build each unique project once
|
||||
3. Push images to the registry
|
||||
4. Replace references with concrete digests (e.g., `ttl.sh/user/app@sha256:...`)
|
||||
4. Replace references with concrete digests (i.e., `@sha256:...`)
|
||||
5. Output resolved YAML to stdout
|
||||
|
||||
**Note**: Multiple references to the same path are deduplicated - the image is built only once and all references are updated with the same digest.
|
||||
|
|
@ -437,7 +433,7 @@ Options:
|
|||
|
||||
```bash
|
||||
# Build and deploy in one command
|
||||
export KRUST_REPO=ttl.sh/myuser
|
||||
export KRUST_REPO=<repository-to-push-to>
|
||||
krust apply -f deployment.yaml
|
||||
|
||||
# Apply entire directory
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue