This file contains 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
FROM ubuntu | |
RUN apt update && apt install git -y | |
# Install rbenv | |
RUN git clone https://github.com/rbenv/rbenv.git /usr/local/.rbenv | |
ENV PATH /usr/local/.rbenv/bin:$PATH | |
RUN eval "$(rbenv init -)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another working Dockefile:
Output:
Sending build context to Docker daemon 4.096kB
Step 1/10 : FROM ubuntu:bionic
---> e28a50f651f9
Step 2/10 : RUN apt-get update && apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs
---> Using cache
---> 8ed1365cc420
Step 3/10 : RUN git clone https://github.com/rbenv/rbenv.git /usr/local/.rbenv
---> Using cache
---> 08a7d6b5d394
Step 4/10 : ENV PATH /usr/local/.rbenv/bin:$PATH
---> Using cache
---> d86abc327822
Step 5/10 : RUN eval "$(rbenv init -)"
---> Using cache
---> 967b91095363
Step 6/10 : RUN git clone https://github.com/rbenv/ruby-build.git /usr/local/.rbenv/plugins/ruby-build
---> Using cache
---> 52cc0a41cd87
Step 7/10 : ENV PATH /usr/local/.rbenv/plugins/ruby-build/bin:$PATH
---> Using cache
---> c27b6e569623
Step 8/10 : RUN git clone https://github.com/rbenv/rbenv-default-gems.git /usr/local/.rbenv/plugins/rbenv-default-gems
---> Using cache
---> f852fae7be28
Step 9/10 : ENV PATH /usr/local/.rbenv/plugins/rbenv-default-gems/bin:$PATH
---> Using cache
---> 833630c44a4c
Step 10/10 : RUN eval "$(rbenv init -)" && rbenv install 2.3.1
---> Running in 4bf89ef84c25
To follow progress, use 'tail -f /tmp/ruby-build.20230125131711.55.log' or pass --verbose
Downloading openssl-1.0.2u.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16
Installing openssl-1.0.2u...
Installed openssl-1.0.2u to /root/.rbenv/versions/2.3.1
Downloading ruby-2.3.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2
Installing ruby-2.3.1...
WARNING: ruby-2.3.1 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
Installed ruby-2.3.1 to /root/.rbenv/versions/2.3.1
NOTE: to activate this Ruby version as the new default, run: rbenv global 2.3.1
Removing intermediate container 4bf89ef84c25
---> c3ffb3ee91fc
Successfully built c3ffb3ee91fc