Skip to content

feat: bake mise tools into a shared dir on dogfood image#25387

Merged
ThomasK33 merged 3 commits into
mainfrom
thomas/dogfood-devcontainer-cli-mise
May 15, 2026
Merged

feat: bake mise tools into a shared dir on dogfood image#25387
ThomasK33 merged 3 commits into
mainfrom
thomas/dogfood-devcontainer-cli-mise

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented May 15, 2026

Copy link
Copy Markdown
Member

Three changes to make mise-managed tooling reach every dogfood workspace cleanly, with the upstream devcontainers-cli module fix as the original trigger.

Why the module breaks

The upstream devcontainers-cli coder module does npm install -g @devcontainers/cli and then verifies the binary is on PATH. With mise-managed Node (introduced in #25282), npm install -g lands the binary at $MISE_DATA_DIR/installs/node/<ver>/bin/, which is not on PATH and which mise reshim does not surface as a shim. The post-install check fails:

Installing @devcontainers/cli using npm...
changed 1 package in 661ms
Reshimming mise 26...
Installation completed but 'devcontainer' command not found in PATH

Even though nothing the user does is actually broken.

What this PR does

  1. mise.toml — pre-install @devcontainers/cli via mise's npm: backend (npm:@devcontainers/cli = "0.87.0"). The mise shim lands at $MISE_DATA_DIR/shims/devcontainer, on PATH. The upstream module's run.sh short-circuits on its command -v devcontainer check and exits 0 without ever running the broken npm-install path. Strictly redundant after fix the second point makes npm i -g work natively, but kept for build-time pre-install and pinned-version reasons matching the other mise-pinned CLIs.

  2. dogfood/coder/ubuntu-*.04/Dockerfile — set NPM_CONFIG_PREFIX=/home/coder/.npm-global and prepend /home/coder/.npm-global/bin to PATH. With this, generic npm install -g <pkg> (prettier, biome, anything frontend folks reach for) lands in a stable home-volume dir that is already on PATH, survives node version bumps, and needs no mise reshim. The mise npm: backend keeps using its own --prefix internally so the npm:@devcontainers/cli pin still installs under $MISE_DATA_DIR as before.

  3. dogfood/coder/ubuntu-*.04/Dockerfile — install image tools into /opt/mise/data at build time (owned by coder) and expose them at runtime via MISE_SHARED_INSTALL_DIRS=/opt/mise/data/installs, keeping MISE_DATA_DIR=/home/coder/.local/share/mise for the user's own installs. This decouples baked tool versions from the home volume's copy-on-first-mount: fresh and existing workspaces both immediately see the image's tool set without a mise install step, and the user's own mise install <tool> / mise use --global still lands on the home volume. The /opt/mise/data/shims dir trails the user shim dir on PATH so a user-installed version wins when both exist.

Pinned to 0.87.0 (current latest) so Renovate/Dependabot can bump deliberately, matching the policy applied to the other floating tools during the mise migration (lazygit, doctl, jj, typos, watchexec).

The upstream `devcontainers-cli` coder module runs `npm install -g
@devcontainers/cli` and then verifies the binary is on PATH. With
mise-managed Node, npm-global binaries land under
`$MISE_DATA_DIR/installs/node/<ver>/bin/` which is not directly on
PATH and which `mise reshim` does not surface as a shim. The
module's post-install PATH check fails and the workspace start log
shows a red error even though nothing the user does is broken.

Installing through `mise:npm:` puts the binary at a shim under
`$MISE_DATA_DIR/shims` (which IS on PATH). The module's run.sh
short-circuits on its very first `command -v devcontainer` check
and exits 0 without ever running the broken npm-install path.

Pin to 0.87.0 (current latest) so Renovate/Dependabot can bump
deliberately, matching the policy applied to other floating tools
during the mise migration (lazygit, doctl, jj, typos, watchexec).

Change-Id: Ic99a1a776d7aefbe24567448f6fbd91901ce99ca
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 changed the title feat(mise.toml): ship @devcontainers/cli via mise's npm: backend feat: ship @devcontainers/cli via mise's npm: backend May 15, 2026
@ThomasK33 ThomasK33 changed the title feat: ship @devcontainers/cli via mise's npm: backend feat(dogfood/coder): install @devcontainers/cli via mise + reshim on start May 15, 2026
@ThomasK33 ThomasK33 changed the title feat(dogfood/coder): install @devcontainers/cli via mise + reshim on start feat: install @devcontainers/cli via mise + reshim on start May 15, 2026
@ThomasK33 ThomasK33 changed the title feat: install @devcontainers/cli via mise + reshim on start feat: pin @devcontainers/cli via mise and stabilize npm globals May 15, 2026
@ThomasK33 ThomasK33 force-pushed the thomas/dogfood-devcontainer-cli-mise branch from 378475c to b3cd70c Compare May 15, 2026 14:13
@ThomasK33 ThomasK33 changed the title feat: pin @devcontainers/cli via mise and stabilize npm globals feat: bake mise tools into a shared dir on dogfood image May 15, 2026
@ThomasK33 ThomasK33 marked this pull request as ready for review May 15, 2026 14:17
Direct `npm i -g` installs land in mise's version-specific node bin
dir, which is not on the static PATH and gets orphaned on every node
version bump. Set NPM_CONFIG_PREFIX=/home/coder/.npm-global and put
the matching bin dir first on PATH so globals like prettier resolve
without `mise reshim` and survive node version bumps.

Change-Id: I30680ec64c99e1348a0b22408c4c125b10c2d7df
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 force-pushed the thomas/dogfood-devcontainer-cli-mise branch from b3cd70c to 2ca5303 Compare May 15, 2026 14:21
Comment thread dogfood/coder/ubuntu-22.04/Dockerfile Outdated
/usr/local/bin/mise install --yes && \
PATH="$MISE_DATA_DIR/shims:$PATH" pnpm dlx playwright@1.47.0 install --with-deps chromium && \
PATH="/opt/mise/data/shims:$PATH" MISE_DATA_DIR=/opt/mise/data pnpm dlx playwright@1.47.0 install --with-deps chromium && \
sudo --user=coder rm -rf /opt/mise/data/cache /opt/mise/data/downloads && \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why with --user coder?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, it was unnecessary.

Comment thread mise.toml

# Pre-installs the binary so the upstream devcontainers-cli coder
# module's `command -v devcontainer` short-circuit fires
"npm:@devcontainers/cli" = "0.87.0"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the devcontainers-cli module if we pre-bake it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, I don’t need the module anymore. Since the module short-circuits if the CLI already exists or is already installed, I wanted to remove it in a separate PR in a week to make sure I’m not breaking anyone’s existing workflow.

Install image tools into /opt/mise/data at build time (owned by
coder) and expose them at runtime via MISE_SHARED_INSTALL_DIRS,
while keeping MISE_DATA_DIR on the home volume for user installs.
This decouples baked tool versions from the home volume's
copy-on-first-mount: existing workspaces immediately see image
tool bumps on next start without a `mise install` step, and the
user's own `mise install <tool>` still lands on the home volume.

Change-Id: I41781822ab01babeef5466f8303b8b6493b6ca14
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Kosiewski <tk@coder.com>
@ThomasK33 ThomasK33 force-pushed the thomas/dogfood-devcontainer-cli-mise branch from 2ca5303 to 0b0b3bc Compare May 15, 2026 14:35
@ThomasK33 ThomasK33 merged commit 6d7fb07 into main May 15, 2026
28 checks passed
@ThomasK33 ThomasK33 deleted the thomas/dogfood-devcontainer-cli-mise branch May 15, 2026 14:43
@github-actions github-actions Bot locked and limited conversation to collaborators May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants