Created
February 22, 2021 03:10
-
-
Save kevinhq/3e765798ae2bd228f5ea13dd6558f261 to your computer and use it in GitHub Desktop.
Dockerfile for Ruby 2.3 on Gitpod
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:16.04 | |
RUN apt-get update | |
### base ### | |
RUN apt-get update && \ | |
apt-get install -yq build-essential sudo vim wget links curl rsync bc git git-core apt-transport-https libxml2 \ | |
libxml2-dev libcurl4-openssl-dev openssl sqlite3 libsqlite3-dev gawk libreadline6-dev libyaml-dev autoconf \ | |
libgdbm-dev libncurses5-dev automake zlib1g-dev libgmp-dev libssl-dev libmysqlclient-dev libpq-dev gnupg2 && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod \ | |
# passwordless sudo for users in the 'sudo' group | |
&& sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers | |
ENV HOME=/home/gitpod | |
WORKDIR $HOME | |
RUN { echo && echo "PS1='\[\e]0;\u \w\a\]\[\033[01;32m\]\u\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\] \\\$ '" ; } >> .bashrc | |
RUN sudo echo "Running 'sudo' for Gitpod: success" && \ | |
# create .bashrc.d folder and source it in the bashrc | |
mkdir /home/gitpod/.bashrc.d && \ | |
(echo; echo "for i in \$(ls \$HOME/.bashrc.d/*); do source \$i; done"; echo) >> /home/gitpod/.bashrc | |
RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import - \ | |
&& curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - \ | |
&& curl -fsSL https://get.rvm.io | bash -s stable \ | |
&& bash -lc " \ | |
rvm requirements \ | |
&& rvm install 2.3.6 \ | |
&& rvm use 2.3.6 --default \ | |
&& rvm rubygems current \ | |
&& gem install bundler --no-document \ | |
&& gem install solargraph --no-document" \ | |
&& echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session | |
ENV GEM_HOME=/workspace/.rvm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment