Docker Image for JSON-Werkstatt CLI
Deploy the official CLI container in under three seconds. The `ghcr.io/json-werkstatt/cli` image is built on Alpine Linux 3.19, precompiled with Go 1.22, and optimized for ephemeral CI runners with zero external dependencies.
Minimal Footprint, Full Feature Set
At just 41MB compressed, the image bundles `jq` v1.7.1, `yq` v4.40.5, and the JSON-Werkstatt binary. Multi-arch support covers `linux/amd64` and `linux/arm64` for consistent builds across GitHub-hosted and self-managed runners.
Automated Vulnerability Scanning
Every release triggers Trivy scans and SBOM generation. Image tags follow strict semantic versioning (`v2.4.1`, `v2.4.1-alpine`), with digest pinning recommended for production pipelines to guarantee reproducible builds.
Pipeline Configuration Examples
Integrate schema validation, data normalization, and strict linting directly into your version control workflow. These production-tested snippets handle large payloads and fail fast on structural drift.
Validate & Transform on Push
Triggers on `main` branch commits. Mounts workspace cache to skip redundant schema downloads, runs `json-werkstatt validate`, and outputs normalized artifacts to `./dist/`. Average execution time drops to 14 seconds.
name: JSON Pipeline
on:
push:
branches: [ main ]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run JSON-Werkstatt
uses: json-werkstatt/validate-action@v2
with:
schema: ./schemas/api-v3.json
input: ./src/data/*.json
output: ./dist/normalized.json
Lint & Report on Merge Request
Executes in the `test` stage during merge requests. Pulls the CLI image, runs `json-werkstatt lint --strict`, and uploads a SARIF-compliant report to GitLab’s code quality dashboard. Automatically blocks merges when schema contracts break.
stages:
- test
json-lint:
stage: test
image: ghcr.io/json-werkstatt/cli:v2.4.1
script:
- json-werkstatt lint --strict ./config/
- json-werkstatt report --format=sarif > gl-code-quality-report.json
artifacts:
reports:
codequality: gl-code-quality-report.json