diff --git a/.github/actions/build-kit/action.yml b/.github/actions/build-kit/action.yml new file mode 100644 index 0000000..b5027f6 --- /dev/null +++ b/.github/actions/build-kit/action.yml @@ -0,0 +1,67 @@ +name: Build kit +description: >- + Resolves a kit's pinned version, builds it multi-platform into a local OCI + layout, and validates it with kit-tck. Does not push — that's the caller's + job once this passes. Assumes the caller already checked out the repo. + +inputs: + kit: + description: Kit name (a kits//.yaml must exist) + required: true + +outputs: + version: + description: The kit's pinned version, read from args.version.default + value: ${{ steps.kit.outputs.version }} + descriptor: + description: Path to the kit's descriptor, relative to the repo root + value: ${{ steps.kit.outputs.descriptor }} + layout: + description: Path to the exported OCI layout kit-tck validated + value: ${{ steps.build.outputs.layout }} + +runs: + using: composite + steps: + # Installs yq and kit-tck per the repo's own mise.toml (see there for + # why kit-tck is pinned by GitHub release rather than a registry + # shorthand). This is the same mise this repo ships a sandbox kit for — + # dev tooling here uses it too rather than hand-rolling installs. + - uses: jdx/mise-action@v4 + + - id: kit + shell: bash + run: | + set -eu + descriptor="kits/${{ inputs.kit }}/${{ inputs.kit }}.yaml" + version="$(yq -r '.args.version.default' "$descriptor")" + if [ -z "$version" ] || [ "$version" = "null" ]; then + echo "no args.version.default in $descriptor" >&2 + exit 1 + fi + echo "version=$version" >> "$GITHUB_OUTPUT" + echo "descriptor=$descriptor" >> "$GITHUB_OUTPUT" + + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + + # Multi-platform build, exported as an OCI layout (no registry needed) + # so kit-tck can judge every platform manifest before anything is + # published. + - id: build + shell: bash + run: | + set -eu + layout="/tmp/${{ inputs.kit }}-layout" + docker buildx build "kits/${{ inputs.kit }}" \ + -f "${{ steps.kit.outputs.descriptor }}" \ + --platform linux/amd64,linux/arm64 \ + --cache-from "type=gha,scope=${{ inputs.kit }}" \ + --cache-to "type=gha,scope=${{ inputs.kit }},mode=max" \ + -t "${{ inputs.kit }}:${{ steps.kit.outputs.version }}" \ + --output "type=oci,dest=${layout},tar=false" + echo "layout=$layout" >> "$GITHUB_OUTPUT" + + - shell: bash + run: | + kit-tck validate --layout "${{ steps.build.outputs.layout }}" "${{ steps.kit.outputs.version }}" diff --git a/.github/actions/discover-kits/action.yml b/.github/actions/discover-kits/action.yml new file mode 100644 index 0000000..b4fb02c --- /dev/null +++ b/.github/actions/discover-kits/action.yml @@ -0,0 +1,23 @@ +name: Discover kits +description: >- + Lists every kits// directory that follows the companion-pair + convention (a kits//.yaml descriptor). + +outputs: + kits: + description: JSON array of kit names, e.g. ["mise"] + value: ${{ steps.discover.outputs.kits }} + +runs: + using: composite + steps: + - id: discover + shell: bash + run: | + set -eu + kits=$(for d in kits/*/; do + name="$(basename "$d")" + [ -f "${d}${name}.yaml" ] && echo "$name" + done | jq -R -s -c 'split("\n") | map(select(length > 0))') + echo "Found kits: $kits" + echo "kits=$kits" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/publish-kits.yml b/.github/workflows/publish-kits.yml new file mode 100644 index 0000000..4d1d047 --- /dev/null +++ b/.github/workflows/publish-kits.yml @@ -0,0 +1,65 @@ +name: Publish kits + +on: + push: + branches: [main] + paths: ["kits/**", "mise.toml", ".github/actions/**", ".github/workflows/publish-kits.yml"] + workflow_dispatch: {} + +concurrency: + group: publish-kits-${{ github.ref }} + cancel-in-progress: false + +permissions: + contents: read + packages: write + +jobs: + discover: + runs-on: ubuntu-24.04 + outputs: + kits: ${{ steps.discover.outputs.kits }} + steps: + - uses: actions/checkout@v4 + - id: discover + uses: ./.github/actions/discover-kits + + publish: + needs: discover + if: needs.discover.outputs.kits != '[]' + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + kit: ${{ fromJson(needs.discover.outputs.kits) }} + steps: + - uses: actions/checkout@v4 + + # Same build + kit-tck gate as validate-kits.yml — a kit that fails + # conformance never reaches the push step below. + - id: build + uses: ./.github/actions/build-kit + with: + kit: ${{ matrix.kit }} + + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push + run: | + # Several kits share this one repository, so the kit and its + # version live in the tag rather than the path: - is + # the immutable reference, the moving tag consumers can pin + # past, matching docker/sandbox-kit-spec's RequireVersionedProvides. + repo="$(echo 'ghcr.io/${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" + docker buildx build "kits/${{ matrix.kit }}" \ + -f "${{ steps.build.outputs.descriptor }}" \ + --platform linux/amd64,linux/arm64 \ + --cache-from "type=gha,scope=${{ matrix.kit }}" \ + --push \ + -t "${repo}:${{ matrix.kit }}-${{ steps.build.outputs.version }}" \ + -t "${repo}:${{ matrix.kit }}" \ + --metadata-file "/tmp/${{ matrix.kit }}-push.json" diff --git a/.github/workflows/validate-kits.yml b/.github/workflows/validate-kits.yml new file mode 100644 index 0000000..71d6363 --- /dev/null +++ b/.github/workflows/validate-kits.yml @@ -0,0 +1,44 @@ +name: Validate kits + +on: + pull_request: + paths: ["kits/**", "mise.toml", ".github/actions/**", ".github/workflows/validate-kits.yml"] + push: + branches-ignore: [main] + paths: ["kits/**", "mise.toml", ".github/actions/**", ".github/workflows/validate-kits.yml"] + workflow_dispatch: {} + +concurrency: + group: validate-kits-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + discover: + runs-on: ubuntu-24.04 + outputs: + kits: ${{ steps.discover.outputs.kits }} + steps: + - uses: actions/checkout@v4 + - id: discover + uses: ./.github/actions/discover-kits + + validate: + needs: discover + if: needs.discover.outputs.kits != '[]' + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + kit: ${{ fromJson(needs.discover.outputs.kits) }} + steps: + - uses: actions/checkout@v4 + + # Builds multi-platform, exports an OCI layout, and runs kit-tck + # against it — see .github/actions/build-kit. No push here; that only + # happens from publish-kits.yml, on main. + - uses: ./.github/actions/build-kit + with: + kit: ${{ matrix.kit }} diff --git a/LICENSE b/LICENSE index 261eeb9..ab7fafb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,201 +1,21 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +MIT License + +Copyright (c) 2026 labset + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 2d6e469..7a14506 100644 --- a/README.md +++ b/README.md @@ -1 +1,55 @@ -# docker-sandboxes \ No newline at end of file +# docker-sandboxes + +A collection of [Docker sandbox kits](https://github.com/docker/sandbox-kit-spec) +(v3 descriptor). Each kit lives under `kits//` as a self-contained +companion pair — descriptor, content recipe, agent-context body and README — +found by filename stem: + +```text +kits// + .yaml # the descriptor; first line `# syntax=docker/sandbox-kit:3` + .dockerfile # the content recipe + -context.md # agent-context body + README.md +``` + +## Kits + +| Kit | Kind | What it adds | +|---|---|---| +| [`mise`](kits/mise) | mixin | [mise-en-place](https://mise.jdx.dev) (`mise`), the polyglot tool version/task manager, as a pinned static binary — no `mise.toml` orchestration | + +## Adding a kit + +Use the `create-kit-v3` skill from +[docker/sandbox-kit-spec](https://github.com/docker/sandbox-kit-spec/blob/main/skills/create-kit-v3/SKILL.md) +as the authoring reference — it covers choosing `workload` vs `mixin`, +capability declarations, version pinning, and the `docker buildx` / `sbx` / +`kit-tck` build-verify loop. Each new kit gets its own `kits//` +directory following the layout above. + +## Tooling + +- **`docker buildx`** — builds a kit; nothing extra to install, BuildKit + pulls the `docker/sandbox-kit:3` frontend from each descriptor's `# syntax=` + line. +- **`sbx`** — runs a kit as, or composed onto, a sandbox. See + [Docker Docs](https://docs.docker.com/ai/sandboxes/install/). +- **`kit-tck`** and **`yq`** — pinned in this repo's own `mise.toml`. Run + `mise install` once (or use [`mise-action`](https://github.com/jdx/mise-action) + in CI, as the workflows below do) rather than installing either by hand. + +## CI + +Two workflows, both built from the same [`build-kit`](.github/actions/build-kit) +composite action (resolve the kit's pinned version, multi-platform build, +`kit-tck validate`): + +- **[`validate-kits.yml`](.github/workflows/validate-kits.yml)** — pull + requests and pushes to any branch but `main`. Builds and validates every + kit; never pushes. +- **[`publish-kits.yml`](.github/workflows/publish-kits.yml)** — pushes to + `main`. Runs the same build-and-validate gate, then pushes to + `ghcr.io//:-` (immutable) and `:` (moving + tag) — several kits share one repository, so the version lives in the tag + rather than the path. diff --git a/kits/mise/README.md b/kits/mise/README.md new file mode 100644 index 0000000..13654a8 --- /dev/null +++ b/kits/mise/README.md @@ -0,0 +1,51 @@ +# mise + +A [Docker sandbox kit v3](https://github.com/docker/sandbox-kit-spec) mixin +that installs [mise-en-place](https://mise.jdx.dev) (`mise`) as a pinned +static binary. + +This kit doesn't write or manage a `mise.toml` itself — tool versions and +tasks are the composing workload's or the agent's business, configured with +`mise use` or a project's own config files. It does run `mise install` as a +`startup` hook on every boot, so whatever the workspace's own config declares +is installed and ready without the agent having to run it by hand. Verified +against an empty workspace: `mise install` with no config exits 0 as a no-op +("mise all tools are installed"), and it's idempotent against an unchanged +one, so this is safe on every sandbox regardless of whether it carries a +mise.toml. + +All of mise's backends are available (core, aqua, asdf, vfox, npm, PyPI, +cargo, gem, go, GitHub/GitLab, …). The declared network policy covers +mise's own operation and the GitHub-backed backends most tool installs +resolve through; installing from some other registry may need its host +added to the composed workload's policy. See `mise-context.md`. + +## Build & verify + +`kit-tck` and `yq` are pinned in the repo root's `mise.toml` — `mise install` +once to get both rather than installing either by hand. CI runs the same +steps via [`build-kit`](../../.github/actions/build-kit). + +```sh +mise install # from the repo root, once + +cd kits/mise + +# validate the descriptor +docker buildx build . -f mise.yaml --output type=cacheonly + +# build, exported for kit-tck +docker buildx build . -f mise.yaml -t mise:2026.9.16 \ + --output type=oci,dest=/tmp/mise-layout,tar=false +kit-tck validate --layout /tmp/mise-layout 2026.9.16 + +# compose onto a workload and run it +sbx run ./ --kit . --detached --name t . +sbx exec t mise --version +``` + +## Bumping the version + +Edit the `args.version.default` pin in `mise.yaml`. The Dockerfile re-checks +the installed binary's reported version against that pin and fails the build +on a mismatch, so a stale pin cannot silently ship the wrong binary. diff --git a/kits/mise/mise-context.md b/kits/mise/mise-context.md new file mode 100644 index 0000000..6f23194 --- /dev/null +++ b/kits/mise/mise-context.md @@ -0,0 +1,25 @@ +# mise + +`mise` is on PATH at `/usr/local/bin/mise`. + +- This kit does not ship or manage a `mise.toml` / `.tool-versions` itself — + that belongs to the project you're working in, or to a task-specific config + you create yourself. What it does do is run `mise install` on every boot, + so if the workspace already has a config, its tools are installed and + ready before you start — no need to run `mise install` by hand. Adding or + editing tool versions is still on you: `mise use @`, or edit + the config directly, then `mise install` picks it up (immediately if you + run it, automatically on the next boot). +- `mise` is a router to many upstream tool registries (GitHub releases, npm, + PyPI, crates.io, RubyGems, the Go module proxy, arbitrary asdf/vfox plugin + git repos, direct HTTP URLs, …), and which ones a given `mise install` needs + depends entirely on which tools and backends you ask for. The network + policy this kit declares only covers `mise`'s own operation — self-update + and the GitHub-backed backends (core, aqua, ubi, asdf, vfox) most tools use. + If `mise install ` fails on a network refusal for some other + registry (npm, PyPI, a custom plugin host, …), that is the sandbox's + network boundary doing its job — the fix is to add that host to the + composed workload's policy, not to work around it here. +- Unauthenticated calls to the GitHub API are rate-limited; if you hit + `mise`'s GitHub rate limit, that's expected for anonymous use and not a + bug in this kit. diff --git a/kits/mise/mise.dockerfile b/kits/mise/mise.dockerfile new file mode 100644 index 0000000..c16b00c --- /dev/null +++ b/kits/mise/mise.dockerfile @@ -0,0 +1,32 @@ +# syntax=docker/dockerfile:1 +# mise's own install script (pinned to the same release tag as the binary +# below, not the floating mise.run/mise.jdx.dev URL — same trust model as +# downloading the binary directly) already handles OS/arch detection and +# checksum verification, so this stage doesn't hand-roll either. It still +# needs steering: MISE_INSTALL_MUSL forces the fully static build regardless +# of this build stage's own glibc, which is the overlay-portability property +# RECIPES.md asks for, and MISE_INSTALL_FROM_GITHUB keeps the download on +# github.com instead of the script's default mise.jdx.dev CDN mirror. +FROM dhi.io/debian-base:trixie-dev AS build +ARG MISE_VERSION +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates curl \ + && rm -rf /var/lib/apt/lists/* + +# The pin is a claim about content: re-check the reported version after +# install.sh runs, rather than trusting that it installed what we asked for. +RUN set -eux; \ + curl -fsSL -o /tmp/install.sh \ + "https://github.com/jdx/mise/releases/download/v${MISE_VERSION}/install.sh"; \ + MISE_VERSION="v${MISE_VERSION}" \ + MISE_INSTALL_PATH=/out/usr/local/bin/mise \ + MISE_INSTALL_MUSL=1 \ + MISE_INSTALL_FROM_GITHUB=1 \ + MISE_QUIET=1 \ + sh /tmp/install.sh; \ + /out/usr/local/bin/mise --version | grep -q "${MISE_VERSION}" + +# The overlay: one static binary, landing on any base — no dpkg state, +# no shared-library closure, nothing under /home. +FROM scratch +COPY --from=build /out / diff --git a/kits/mise/mise.yaml b/kits/mise/mise.yaml new file mode 100644 index 0000000..3c5934e --- /dev/null +++ b/kits/mise/mise.yaml @@ -0,0 +1,70 @@ +# syntax=docker/sandbox-kit:3 +schemaVersion: "3" +displayName: mise +description: >- + mise-en-place, installed as a pinned static musl binary from GitHub + releases. Does not ship a mise.toml itself, but runs `mise install` on + every boot so the workspace's own config (if any) is honored automatically. +sourceUrl: https://github.com/jdx/mise +licenses: [MIT] + +kind: mixin + +# One value drives the install, the provide, the published version and the +# tag. +version: "${{ kit.args.version }}" + +args: + version: + default: "2026.9.16" + pattern: '^[0-9]+\.[0-9]+\.[0-9]+$' + description: mise release to install + buildArg: MISE_VERSION + +provides: ["mise@${{ kit.args.version }}"] + +# No requires: the overlay ships a self-contained static musl binary and +# needs nothing from the composed base's package manager or libc, so it +# runs unmodified on a Debian, Alpine or distroless workload alike. + +capabilities: + - type: com.docker.sandbox/network-policy@1 + config: + runtime: + allow: + # mise's own self-update, plus the GitHub-backed backends (core, + # aqua, ubi, asdf, vfox) that most tool installs resolve through: + # release asset downloads, source tarballs, and the redirect + # hosts those land on. + - github.com:443 + - api.github.com:443 + - codeload.github.com:443 + - objects.githubusercontent.com:443 + - release-assets.githubusercontent.com:443 + - raw.githubusercontent.com:443 + # mise's registry/shorthand index and version metadata service. + - mise.jdx.dev:443 + # Deliberately not exhaustive: mise is a router to whichever + # upstream registry a given tool's backend names (npm, PyPI, + # crates.io, RubyGems, the Go proxy, arbitrary plugin git hosts, + # direct URLs, …). See mise-context.md for how to extend this. + + - type: com.docker.sandbox/lifecycle@1 + config: + startup: + # mise install is a no-op when nothing is configured (verified: + # exits 0 with "mise all tools are installed" against an empty + # workspace) and idempotent against an unchanged one, so this is + # safe to run on every boot rather than gated to install-once. + # Proxy vars are declared for the package-manager backends (npm, + # pip, cargo, go, gem) that shell out to a child process needing + # them; the hook's own GitHub egress is already covered under this + # kit's runtime network-policy above. + - command: [mise, install] + env: [HTTP_PROXY, HTTPS_PROXY, NO_PROXY, http_proxy, https_proxy, no_proxy] + background: false + description: Install the tools the workspace's mise config declares + + - type: com.docker.sandbox/agent-context@1 + config: + contentFile: ./mise-context.md diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..ac407f9 --- /dev/null +++ b/mise.toml @@ -0,0 +1,4 @@ +# Dev tooling for this repo's kits (build + validate), used locally and in CI. +[tools] +yq = "4.53.6" +"github:docker/sandbox-kit-spec" = "3.0.0-m.6" # kit-tck