-
Notifications
You must be signed in to change notification settings - Fork 462
Add Mise Runtime Version Manager Feature #1356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zakariaf
wants to merge
4
commits into
devcontainers:main
Choose a base branch
from
zakariaf:feature/add-mise-runtime-manager
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2bb7d89
Add Mise runtime version manager feature
zakariaf 8132ba0
Add test scripts and scenarios for Mise feature across multiple distr…
zakariaf 057628b
Remove unused UPDATE_RC variable from install script
zakariaf 8e63238
Merge branch 'main' into feature/add-mise-runtime-manager
AlvaroRausell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## Using Mise in your Dev Container | ||
|
||
After installing Mise, you can manage language versions by adding a `.mise.toml` file to your project root: | ||
|
||
```toml | ||
[tools] | ||
node = "20" | ||
python = "3.11" | ||
``` | ||
|
||
Or use the CLI to install tools: | ||
|
||
```bash | ||
mise install node@20 | ||
mise install [email protected] | ||
``` | ||
|
||
For more information on using Mise, see the [official documentation](https://mise.jdx.dev/). | ||
|
||
## OS Support | ||
|
||
This Feature should work on recent versions of Debian/Ubuntu, RedHat Enterprise Linux, Fedora, and Alpine Linux distributions with the `apt`, `yum` or `dnf` package manager installed. | ||
|
||
`bash` is required to execute the `install.sh` script. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"id": "mise", | ||
"version": "1.0.0", | ||
"name": "Mise (formerly RTX)", | ||
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/mise", | ||
"description": "Installs Mise, the unified runtime version manager (formerly RTX). Mise works like asdf, rvm, nvm, pyenv, etc - but is a single unified tool for managing all your runtimes.", | ||
"options": { | ||
"version": { | ||
"type": "string", | ||
"proposals": [ | ||
"latest", | ||
"none", | ||
"v2025.5.0", | ||
"v2025.4.12", | ||
"v2025.4.11", | ||
"v2025.4.10" | ||
], | ||
"default": "latest", | ||
"description": "Select or enter a Mise version to install" | ||
}, | ||
"installPlugins": { | ||
"type": "string", | ||
"default": "", | ||
"description": "Comma separated list of Mise plugins to install (e.g., 'node,python,ruby')" | ||
} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"github.copilot.chat.codeGeneration.instructions": [ | ||
{ | ||
"text": "This dev container includes Mise (formerly RTX), a unified runtime version manager pre-installed and available on the `PATH`. Mise allows you to manage multiple programming language versions (similar to asdf, nvm, pyenv, etc.) with a single tool." | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"installsAfter": [ | ||
"ghcr.io/devcontainers/features/common-utils" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/usr/bin/env bash | ||
#------------------------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. | ||
#------------------------------------------------------------------------------------------------------------- | ||
# | ||
# Docs: https://github.com/devcontainers/features/tree/main/src/mise | ||
# Maintainer: The Dev Container spec maintainers | ||
|
||
set -eux | ||
|
||
# Feature options | ||
MISE_VERSION="${VERSION}" | ||
INSTALL_PLUGINS="${INSTALLPLUGINS:-""}" | ||
|
||
# Install dependencies based on OS | ||
. /etc/os-release | ||
|
||
echo "(*) Installing dependencies for ${ID}..." | ||
if [ "${ID}" = "debian" ] || [ "${ID}" = "ubuntu" ]; then | ||
apt-get update | ||
apt-get install -y curl ca-certificates | ||
elif [ "${ID}" = "fedora" ] || [ "${ID}" = "rhel" ] || [ "${ID}" = "centos" ] || [ "${ID}" = "rocky" ] || [ "${ID}" = "almalinux" ]; then | ||
if command -v dnf >/dev/null; then | ||
dnf install -y curl | ||
else | ||
yum install -y curl | ||
fi | ||
fi | ||
|
||
# Install mise using the appropriate method for the OS | ||
if [ "${MISE_VERSION}" != "none" ]; then | ||
echo "(*) Installing mise version ${MISE_VERSION}..." | ||
|
||
export MISE_INSTALL_PATH="/usr/local/bin/mise" | ||
if [ "${MISE_VERSION:-latest}" = "latest" ]; then | ||
# latest: installer’s default, so don’t set MISE_VERSION | ||
curl -sSf https://mise.run | sh | ||
else | ||
# pinned: pass through MISE_VERSION | ||
curl -sSf https://mise.run | MISE_VERSION="${MISE_VERSION}" sh | ||
fi | ||
|
||
# Verify mise is installed | ||
if command -v mise >/dev/null 2>&1; then | ||
echo "mise installed successfully: $(mise --version)" | ||
else | ||
echo "ERROR: mise installation failed. Could not find mise in PATH." | ||
exit 1 | ||
fi | ||
|
||
# Install plugins if specified | ||
if [ -n "${INSTALL_PLUGINS}" ]; then | ||
echo "Installing mise plugins: ${INSTALL_PLUGINS}" | ||
IFS="," | ||
read -ra plugins <<< "${INSTALL_PLUGINS}" | ||
for plugin in "${plugins[@]}"; do | ||
echo "Installing plugin: ${plugin}" | ||
mise plugins install ${plugin} | ||
done | ||
fi | ||
else | ||
echo "Skipping mise installation as 'none' was specified." | ||
fi | ||
|
||
echo "Done!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library | ||
source dev-container-features-test-lib | ||
|
||
# Definition specific tests | ||
check "mise version" mise --version | ||
|
||
# Check for correct Debian paths | ||
check "mise in PATH" bash -c "which mise | grep '/usr/local/bin/mise\\|/usr/bin/mise'" | ||
|
||
# Report result | ||
reportResults |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library | ||
source dev-container-features-test-lib | ||
|
||
# Definition specific tests | ||
check "mise version" mise --version | ||
|
||
# Print out where mise actually lives | ||
echo "DEBUG: mise resolved to: $(command -v mise)" | ||
|
||
# Check for correct Fedora paths | ||
check "mise in PATH" bash -c "command -v mise | grep '/usr/local/bin/mise'" | ||
|
||
# Report result | ||
reportResults |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library | ||
source dev-container-features-test-lib | ||
|
||
# Check we have the expected version of mise | ||
check "mise version v2024.5.17" bash -c "mise --version | grep '2024.5.17'" | ||
|
||
# Report result | ||
reportResults |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library | ||
source dev-container-features-test-lib | ||
|
||
# Check for mise | ||
check "mise version" mise --version | ||
|
||
# Check for plugins | ||
check "yarn plugin installed" bash -c "mise plugins list | grep yarn" | ||
check "redis plugin installed" bash -c "mise plugins list | grep redis" | ||
|
||
# Report result | ||
reportResults |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library | ||
source dev-container-features-test-lib | ||
# Print out where mise actually lives | ||
echo "DEBUG: mise resolved to: $(which mise)" | ||
|
||
# Definition specific tests | ||
check "mise version" mise --version | ||
|
||
# Check for correct RHEL paths | ||
check "mise in PATH" bash -c "command -v mise | grep '/usr/local/bin/mise'" | ||
|
||
# Report result | ||
reportResults |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"install_specific_version": { | ||
"image": "ubuntu:focal", | ||
"features": { | ||
"mise": { | ||
"version": "v2024.5.17" | ||
} | ||
} | ||
}, | ||
"install_with_plugins": { | ||
"image": "ubuntu:focal", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
"features": { | ||
"mise": { | ||
"installPlugins": "yarn,redis" | ||
} | ||
} | ||
}, | ||
"rhel": { | ||
"image": "almalinux:8", | ||
"features": { | ||
"mise": {} | ||
} | ||
}, | ||
"debian": { | ||
"image": "debian:bullseye", | ||
"features": { | ||
"mise": {} | ||
} | ||
}, | ||
"fedora": { | ||
"image": "fedora:latest", | ||
"features": { | ||
"mise": {} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Optional: Import test library | ||
source dev-container-features-test-lib | ||
|
||
# Definition specific tests | ||
check "mise version" mise --version | ||
check "mise activate command" mise activate bash | ||
check "mise plugins command" mise plugins list | ||
|
||
# Report result | ||
reportResults |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please use
ubuntu:jammy
orubuntu:noble
here instead ofubuntu:focal
as base image. Theubuntu focal(20.04)
is going out of support after May 31st, 2025.