|
1 | | -# Rsync - Docker mod for openssh-server |
| 1 | +# Rbenv - Docker mod for code-server |
2 | 2 |
|
3 | | -This mod adds rsync to openssh-server, to be installed/updated during container start. |
| 3 | +This mod adds [rbenv](https://github.com/rbenv/rbenv) to code-server, to be installed/updated during container start. |
4 | 4 |
|
5 | | -In openssh-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:openssh-server-rsync` |
| 5 | +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. |
6 | 6 |
|
7 | | -If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:openssh-server-rsync|linuxserver/mods:openssh-server-mod2` |
| 7 | +In code-server docker arguments, set an environment variable `DOCKER_MODS=linuxserver/mods:code-server-rbenv` |
8 | 8 |
|
9 | | -# Mod creation instructions |
| 9 | +If adding multiple mods, enter them in an array separated by `|`, such as `DOCKER_MODS=linuxserver/mods:code-server-rbenv|linuxserver/mods:openssh-server-mod2` |
10 | 10 |
|
11 | | -* Fork the repo, create a new branch based on the branch `template`. |
12 | | -* Edit the `Dockerfile` for the mod. `Dockerfile.complex` is only an example and included for reference; it should be deleted when done. |
13 | | -* Inspect the `root` folder contents. Edit, add and remove as necessary. |
14 | | -* After all init scripts and services are created, run `find ./ -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print -exec chmod +x {} +` to fix permissions. |
15 | | -* Edit this readme with pertinent info, delete these instructions. |
16 | | -* Finally edit the `.github/workflows/BuildImage.yml`. Customize the vars for `BASEIMAGE` and `MODNAME`. Set the versioning logic and `MULTI_ARCH` if needed. |
17 | | -* Ask the team to create a new branch named `<baseimagename>-<modname>`. Baseimage should be the name of the image the mod will be applied to. The new branch will be based on the `template` branch. |
18 | | -* Submit PR against the branch created by the team. |
| 11 | +### Shell completions |
19 | 12 |
|
| 13 | +This mod includes adding [shell completions](https://github.com/rbenv/rbenv?tab=readme-ov-file#shell-completions) for `rbenv` in `bash` and `zsh`. |
20 | 14 |
|
21 | | -## Tips and tricks |
| 15 | +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: |
22 | 16 |
|
23 | | -* Some images have helpers built in, these images are currently: |
24 | | - * [Openvscode-server](https://github.com/linuxserver/docker-openvscode-server/pull/10/files) |
25 | | - * [Code-server](https://github.com/linuxserver/docker-code-server/pull/95) |
| 17 | +``` |
| 18 | +FPATH=~/.rbenv/completions:"$FPATH" |
| 19 | +autoload -U compinit |
| 20 | +compinit |
| 21 | +``` |
| 22 | + |
| 23 | +### Ruby-build |
| 24 | + |
| 25 | +This mod includes [ruby-build](https://github.com/rbenv/ruby-build), which allows you to run the `rbenv install` command. |
| 26 | + |
| 27 | +It will automatically check for an existing `ruby-build` installation upon `docker build`. If it detects `ruby-build`, it will upgrade it. |
| 28 | + |
| 29 | +You can also manually upgrade `ruby-build`, as described in the [documentation](https://github.com/rbenv/ruby-build?tab=readme-ov-file#clone-as-rbenv-plugin-using-git), without bringing down the docker instance by running: |
| 30 | + |
| 31 | +``` |
| 32 | +git -C "$(rbenv root)"/plugins/ruby-build pull |
| 33 | +``` |
| 34 | + |
| 35 | +### Build environment |
| 36 | + |
| 37 | +In order to compile Ruby, you need the proper toolchain and build environment. The required system packages can be found in the [documentation](https://github.com/rbenv/ruby-build/wiki#ubuntudebianmint). |
| 38 | + |
| 39 | +This mod will install these requirements for you: |
| 40 | + |
| 41 | +* autoconf |
| 42 | +* build-essential |
| 43 | +* libffi-dev |
| 44 | +* libgmp-dev |
| 45 | +* libssl-dev |
| 46 | +* libyaml-dev |
| 47 | +* rustc |
| 48 | +* zlib1g-dev |
| 49 | + |
| 50 | +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`. |
| 51 | + |
| 52 | +### Installed Ruby versions |
| 53 | + |
| 54 | +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. |
0 commit comments