{"id":29139461,"url":"https://github.com/ms-ati/docker-rvm","last_synced_at":"2025-06-30T15:06:03.916Z","repository":{"id":55644208,"uuid":"129137415","full_name":"ms-ati/docker-rvm","owner":"ms-ati","description":"Docker base image for RVM (Ruby Version Manager)","archived":false,"fork":false,"pushed_at":"2020-12-15T21:41:37.000Z","size":23,"stargazers_count":11,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-04-09T05:56:38.458Z","etag":null,"topics":["docker","ruby","rvm"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ms-ati.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-11T18:30:15.000Z","updated_at":"2021-05-22T18:05:37.000Z","dependencies_parsed_at":"2022-08-15T05:20:42.420Z","dependency_job_id":null,"html_url":"https://github.com/ms-ati/docker-rvm","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/ms-ati/docker-rvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms-ati%2Fdocker-rvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms-ati%2Fdocker-rvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms-ati%2Fdocker-rvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms-ati%2Fdocker-rvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ms-ati","download_url":"https://codeload.github.com/ms-ati/docker-rvm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ms-ati%2Fdocker-rvm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262797619,"owners_count":23365889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","ruby","rvm"],"created_at":"2025-06-30T15:06:03.183Z","updated_at":"2025-06-30T15:06:03.889Z","avatar_url":"https://github.com/ms-ati.png","language":"Dockerfile","readme":"# About this repo\n\nDocker base image for [RVM (Ruby Version Manager)](https://rvm.io).\n\n## Usage\n\n### Example Dockerfiles\n\n1. [examples/Dockerfile.multi](https://github.com/ms-ati/docker-rvm/blob/master/examples/Dockerfile.multi)\n   \u003cbr/\u003eAutomated installation of multiple Ruby versions via one simple `ARG` line\n\n   ```bash\n   docker build -t msati/docker-rvm .\n   docker build -t example:multi - \u003c examples/Dockerfile.multi\n   docker run -it example:multi bash -l\n   ```\n\n### Example: Upgrading Ruby version in your app\n\nLet's see how the [Ruby 2.4 Integer Unification](https://blog.bigbinary.com/2016/11/18/ruby-2-4-unifies-fixnum-and-bignum-into-integer.html)\nimpacts us.\n\nWe'll create a directory containing a simple `Dockerfile` which runs `irb`:\n\n```dockerfile\nARG RVM_RUBY_VERSIONS=\"2.3 2.4\"\nFROM msati/docker-rvm\nUSER ${RVM_USER}\nENV RUBY=2.3\nCMD rvm ${RUBY} do irb\n```\n\nGreat! Let's build it.\n\n```bash\ndocker build -t rvm-irb .\n```\n\nOk, it's built. Let's run it:\n\n```bash\ndocker run -it rvm-irb\n\n2.3.4 :001 \u003e 1.class\n =\u003e Fixnum\n```\n\nGreat, now how easy is it to do the same in Ruby 2.4?\n\n```bash\ndocker run -it -e RUBY=2.4 rvm-irb\n\n2.4.1 :001 \u003e 1.class\n =\u003e Integer\n```\n\nVery easy -- and no image rebuild necessary!\n\nPlease note that you'll probably want to use `bash -l` (that is, a\n*login shell*) for any interactive consoles, since that's the easiest\nway to use the RVM cli:\n\n```bash\ndocker run -it rvm-irb bash -l\n\nrvm@629159cda7a8:/$ rvm list\n\nrvm rubies\n\n=* ruby-2.3.4 [ x86_64 ]\n   ruby-2.4.1 [ x86_64 ]\n\n# =\u003e - current\n# =* - current \u0026\u0026 default\n#  * - default\n```\n\nAnd that's about it.\n\n## Why?\n\nWhat use cases motivate dockerizing RVM, rather than using\none of the [official Ruby](https://hub.docker.com/_/ruby/) Docker images?\n\n1. To **easily switch** between multiple Ruby versions in Docker, **without rebuilding**\n   entire image on each switch\n2. To employ [RVM best practices](https://rvm.io/rvm/best-practices), such as per-project gemsets, in Docker\n3. To use an [official Ruby installation method](https://www.ruby-lang.org/en/downloads/) in Docker\n\n### Example: Reporting bugs in Ruby\n\nImagine that your team discovered that a piece of your code causes a crash in\none version of Ruby (let's say 3.0.0-preview2), but not in another (2.7.2).\n\nYou've [reported the issue to Ruby](https://bugs.ruby-lang.org/projects/ruby-trunk/issues),\nand they've asked you to also check if the crash occurs in the trunk (aka head)\nversion of Ruby.\n\n#### What do you do?\n\nBased off of this image, it's as easy as editing an `ARG` line\nat the top of your `Dockerfile`:\n\n```dockerfile\nARG RVM_RUBY_VERSIONS=\"2.7.2 3.0.0-preview2 ruby-head\"\nFROM msati/docker-rvm\n\n# Now carry on as before -- building your project -- the base image will contain\n# a layer in which all of those versions were installed by RVM.\n\n# Later in your Dockerfile, or just interactively in a shell, switch versions\nRUN rvm use --default ruby-head\n```\n\nNote that this also lowers the barrier for others in the community to jump in\nand work from your reproducible test case across Ruby versions.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fms-ati%2Fdocker-rvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fms-ati%2Fdocker-rvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fms-ati%2Fdocker-rvm/lists"}