Sign in

Mod for code-server

Rbenv

This mod adds rbenv to code-server, to be installed/updated during container start.

arch
amd64
built

Use it#

Set DOCKER_MODS on the code-server container and recreate it. The mod is pulled on every start; several mods are separated with |.

DOCKER_MODS=ghcr.io/linuxserver-playground/mods:code-server-rbenv

:code-server-rbenv always gets the newest build. To stay on this one, pin its tag:

DOCKER_MODS=ghcr.io/linuxserver-playground/mods:code-server-rbenv-3790e24
services:
  code-server:
    image: ghcr.io/linuxserver-playground/code-server:latest
    environment:
      - DOCKER_MODS=ghcr.io/linuxserver-playground/mods:code-server-rbenv

Details#

rbenv is a version manager tool for the Ruby programming language on Unix-like systems. It is useful for switching between multiple Ruby versions on the same machine and for ensuring that each project you are working on always runs on the correct Ruby version.

Shell completions

This mod includes adding shell completions for rbenv in bash and zsh.

The zsh completion script ships with the project, but needs to be added to FPATH in zsh before it can be discovered by the shell. So, the mod will automatically detect and update the ~/.zshrc file:

FPATH=~/.rbenv/completions:"$FPATH"
autoload -U compinit
compinit

Ruby-build

This mod includes ruby-build, which allows you to run the rbenv install command.

It will automatically check for an existing ruby-build installation upon docker build. If it detects ruby-build, it will upgrade it.

You can also manually upgrade ruby-build, as described in the documentation, without bringing down the docker instance by running:

git -C "$(rbenv root)"/plugins/ruby-build pull

Build environment

In order to compile Ruby, you need the proper toolchain and build environment. The required system packages can be found in the documentation.

This mod will install these requirements for you:

  • autoconf
  • build-essential
  • libffi-dev
  • libgmp-dev
  • libssl-dev
  • libyaml-dev
  • rustc
  • zlib1g-dev

With these installed, you should be able to compile any of the latest stable Ruby versions, which you can find by running the command rbenv install --list.

Installed Ruby versions

By default, rbenv is installed in ~/.rbenv. This mod will update the permissions of that folder to ensure that your user can install new versions of Ruby into it.

Community project

Improve this mod, or make your own

Mods are how LinuxServer images grow without getting heavier: a Dockerfile, a few scripts and a mod.yml. If this one is missing something, or you need one like it for another image, an AI agent in our harness can build and test it with you.

Ask your agent

  • The code-server-rbenv mod <what is wrong>. Fix it, test it and draft the PR.
  • Make a mod like code-server-rbenv for <another image>, and test it.

Making a mod Every way to help Get the harness (opens in a new tab)

Source: code-server-rbenv branch (opens in a new tab). Every mod