Skip to content

fix(image): give the image the mise command #90

Done

Description

@dan-petty

Problem or Motivation

The devtools image has no mise command. The Dockerfile mounts mise from the mise image for the build only: "Only the build uses mise: the image has no mise command." Two repositories need the command in the devcontainer:

  • dan-petty/infra: the pre-commit hook of .pre-commit-config.yaml has the entry mise exec -- scripts/private-data-scan.sh git --pre-commit --staged. Its README (Tools) and rule 7 of its AGENTS.md say to run mise install --locked with MISE_DATA_DIR in ~/.cache/infra-tools/mise.
  • dan-petty/homelab pins jdx/mise in the same way.

In the devcontainer that was rebuilt on 2026-11-26 (devtools 1.2.2), command -v mise finds nothing. ~/.cache/infra-tools/mise/ holds downloads, installs and shims, and no mise binary, so a commit in infra stops at the hook. Before the rebuild, a stand-in script of 101 bytes at ~/.local/bin/mise (written 2026-11-24) ran the command after mise exec -- with the tools of PATH. That ignores the pins of mise.toml.

Owner direction of 2026-11-26: the devtools image installs the tools, and PATH gives each user of the container the intended versions.

Proposed Solution

Disposition: change the code.

  • Copy the mise binary of the pinned build stage (jdxcode/mise:<tag>@<digest>, which Renovate moves) into the final image at /usr/local/bin/mise.
  • Set MISE_USE_VERSIONS_HOST_TRACK=0 in the environment of the image, as the build stage does, so that no user sends the tracking request.
  • test/tools.sh checks mise --version, and the comment and the documents no longer say that the image has no mise command.

Proof: in a container of the image, mise --version prints the pinned version. In a clone of infra, mise install --locked and the pre-commit hook pass.

Existing Tool Considered

mise (jdx/mise), which the image already pins for its build. The alternative is that each repository installs mise in a home folder. That puts a second copy on PATH for one user, which the owner direction excludes.

Proposed design

Problem statement

The devtools image has no mise command: only the build stage uses mise, so a devcontainer of the image cannot run the mise exec -- scripts/private-data-scan.sh git --pre-commit --staged hook of dan-petty/infra or the pinned tools of infra and homelab, and the 101-byte stand-in script at ~/.local/bin/mise ignores the pins of mise.toml. The image must provide the pinned mise binary at /usr/local/bin/mise, stop the mise version-tracking requests of its users, and keep test/tools.sh and the documents in step with the new command.

Acceptance criteria

Requirement: Image provides the mise command

The last stage of the Dockerfile SHALL copy the mise binary of the pinned jdxcode/mise stage to /usr/local/bin/mise.

Scenario: mise version in the built image

  • WHEN docker run --rm devtools:test mise --version runs on the image that the change builds
  • THEN the command prints the version of the tag that the jdxcode/mise line of the Dockerfile pins and exits 0.

Requirement: Image stops mise version tracking

The last stage of the Dockerfile MUST set MISE_USE_VERSIONS_HOST_TRACK to 0 in the environment of the image.

Scenario: tracking variable in the built image

  • WHEN docker run --rm devtools:test printenv MISE_USE_VERSIONS_HOST_TRACK runs on the image that the change builds
  • THEN the command prints 0 and exits 0.

Requirement: Tools test runs the mise command

test/tools.sh SHALL run mise --version with the other tools of the image.

Scenario: mise in the tools test

  • WHEN the CI runs docker buildx build --build-arg DEVTOOLS=devtools:test --file test/tools.Dockerfile test on the image of the change
  • THEN the build passes, the script prints the mise version, and it prints no FAIL line for mise.

Requirement: Tools test has no absence check

test/tools.sh MUST NOT assert that the mise command is absent.

Scenario: old absence check

  • WHEN grep -n 'command -v mise' test/tools.sh runs
  • THEN the command finds no match and exits 1.

Requirement: Documents name the mise command

README.md, the header comment of the Dockerfile and the comment of test/tools.sh MUST NOT state that mise is build only or absent, and README.md SHALL name the pinned mise image as the source of the mise command.

Scenario: stale build-only text

  • WHEN grep -n 'no mise command' README.md Dockerfile and grep -n 'build only' test/tools.sh run
  • THEN each command finds no match and exits 1.

Requirement: Pending a person after the merge

After the release, a person SHALL prove the mise of the image in a devcontainer of dan-petty/infra.

Scenario: infra pre-commit hook in the rebuilt devcontainer

  • WHEN a person removes the stand-in ~/.local/bin/mise, rebuilds the devcontainer on the released image, and runs mise install --locked with MISE_DATA_DIR=~/.cache/infra-tools/mise in a clone of dan-petty/infra
  • THEN command -v mise prints /usr/local/bin/mise, mise install --locked exits 0, and a staged commit runs mise exec -- scripts/private-data-scan.sh git --pre-commit --staged with exit 0.

Existing Tool Considered

Existing Tool Considered: mise (jdx/mise) is the open, maintained tool that covers the need, and no alternatives check is needed. The image already pins its official image at a digest (Dockerfile:13), and Renovate updates that pin with its dockerfile manager (.github/renovate.json:5). What mise lacks for this need is a way to put its own binary into another image: the official image holds the binary at /usr/local/bin/mise (Dockerfile:29), and mise's install script writes a per-user copy under ~/.local/bin, which the owner direction of 2026-11-26 excludes. The proposal therefore copies the binary from the pinned mise stage into the last stage, as the last stage already does for uv and uvx (Dockerfile:136), and builds no code: nothing to keep and nothing to fix until it matches the tool. It also sets MISE_USE_VERSIONS_HOST_TRACK=0 in the last stage (Dockerfile:28), so a user's mise install sends no version-tracking request.

Key questions

  • How does the final image get the mise binary?: The last stage adds COPY --from=mise /usr/local/bin/mise /usr/local/bin/mise. The mise stage pins the official image at a digest, the binary is at /usr/local/bin/mise in that image, and the last stage already copies a binary from a pinned stage this way for uv and uvx. Renovate's dockerfile manager moves the pin, so no version is copied into code. (best practice) [sources: .github/renovate.json:5]
    • Chosen: Copy from the pinned mise stage. The pin already exists at a digest, Renovate updates it, and the last stage already copies uv and uvx from their pinned stages, so the change adds no download and no version in code.
    • Rejected: Copy from the mise-tools stage. That stage mounts mise from the mise image only for its RUN and keeps no layer with mise (Dockerfile:21, Dockerfile:22), so it has no binary to copy.
    • Rejected: Run the mise install script in the last stage. This adds a network download to each build and a version source that Renovate does not update, and it installs into a home folder rather than /usr/local/bin.
    • Rejected: Let each repository install mise in a home folder. This puts a second copy on PATH for one user and contradicts the owner direction of 2026-11-26.
  • Does the final image set MISE_USE_VERSIONS_HOST_TRACK?: Yes: the last stage adds MISE_USE_VERSIONS_HOST_TRACK=0 to its ENV block, as the mise-tools stage sets it. The Dockerfile records that DO_NOT_TRACK, which the last stage already sets, does not stop the requests to mise-versions.jdx.dev and that this variable does. (proposed)
    • Chosen: Set it in the ENV block of the last stage. The build stage sets it for its own installs, and the ENV block of the last stage is where the image sets the telemetry and update variables that a consumer image inherits.
    • Rejected: Rely on DO_NOT_TRACK=1 only. The comment of the Dockerfile says that DO_NOT_TRACK does not stop these requests.
    • Rejected: Set nothing. Each user's mise install would send a version-tracking request, which the issue excludes.
  • Does the final image set MISE_DATA_DIR for its users?: No. The mise-tools stage exports MISE_DATA_DIR=/tmp/mise only for its own install and removes that folder in the same layer, so nothing of it reaches the last stage. The last stage leaves the variable unset, so the value that a consumer sets applies, and infra sets ~/.cache/infra-tools/mise. (proposed)
    • Chosen: Leave MISE_DATA_DIR unset. The build-stage value is a shared, ephemeral path that the build removes, and a value in the image would override the per-user value that infra sets.
    • Rejected: Set MISE_DATA_DIR=/tmp/mise. The path is shared and ephemeral, and it overrides the value that infra sets for its pinned tools.
  • How does test/tools.sh change?: The script gains run mise --version in the group of tools that it runs, and it drops the comment # mise is a tool of the build only. with the ! command -v mise check. The CI runs the script in the image with --network=none, so the CI run of the change is the proof that the version check needs no network. (best practice) [sources: test/tools.sh:60, test/tools.sh:117, test/tools.Dockerfile:11, .github/workflows/image.yml:166]
    • Chosen: Add run mise --version and drop the absence check. The script already runs each tool of the image once and then checks the state of the image, so the new command fits its first part and the absence check leaves.
    • Rejected: Add a new test script. This duplicates the image test runner and adds a file for one command.
    • Rejected: Check by hand only. A manual check does not fail when the command disappears from a later image.
  • Which texts state that mise is build only or absent?: The header of the Dockerfile says Only the build uses mise: the image has no mise command; test/tools.sh has the comment # mise is a tool of the build only.; and README.md says The build stops the install-tracking requests of mise, the image has no mise command, and the image has no mise command. All of them change in the same pull request, and the README names the mise image as the source of the command, as it does for uv. [sources: test/tools.sh:117, README.md:34, README.md:88, README.md:122]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    status/new
    value/medium
    on Nov 26, 2026
  2. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor
    • Priority: The missing mise binary blocks pre-commit hooks in dan-petty/infra and forces a workaround script, increasing friction for developers on each commit.
    • Related: fix(image): stop the mise install tracking of the build #20, which asks for a different change. Both deal with mise in the devtools image, but #20 stops telemetry during the build stage while the candidate makes the mise binary available to users of the final image.
  3. added
    effort/low
    source/agent
    scope/image
    priority/p1-high
    on Nov 26, 2026
  4. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  5. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 26, 2026
  6. removed
    status/in-review
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p1-highscope/imagesource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions