-
Notifications
You must be signed in to change notification settings - Fork 543
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
2bb7d89
8132ba0
057628b
8e63238
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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. |
| 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" | ||
| ] | ||
| } |
| 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!" |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { | ||
| "install_specific_version": { | ||
| "image": "ubuntu:focal", | ||
|
Contributor
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. Can we please use |
||
| "features": { | ||
| "mise": { | ||
| "version": "v2024.5.17" | ||
| } | ||
| } | ||
| }, | ||
| "install_with_plugins": { | ||
| "image": "ubuntu:focal", | ||
|
Contributor
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": {} | ||
| } | ||
| } | ||
| } | ||
| 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 |
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.
Would is be possible to add few steps regarding the basic utilities of the
misetool such as installing single/ multiple versions of supported languages in the test scripts? For reference test scripts of Oryx feature could be referred.