Created
September 22, 2023 15:38
-
-
Save jkeam/b0f57a93c3769fe6f2e3894deaed251d to your computer and use it in GitHub Desktop.
Dockerfile to build a Universal Developer Image for Dev Spaces to include Ruby and Rails
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 quay.io/devfile/universal-developer-image:latest | |
# The following commands require root | |
USER 0 | |
# Install a recent version of ruby | |
ENV RUBY_VERSION 3.1.2 | |
RUN dnf -y update && \ | |
dnf -y install rbenv ruby-build sqlite && \ | |
dnf -y clean all --enablerepo='*' && \ | |
rbenv install $RUBY_VERSION && \ | |
rbenv global $RUBY_VERSION && \ | |
echo 'eval "$(rbenv init - bash)"' >> $HOME/.bashrc && \ | |
echo 'eval "$(rbenv init - sh)"' > /etc/profile.d/rbenv.sh | |
ENV PATH="${HOME}/.rbenv/shims:${PATH}" ENV="/etc/profile" | |
# Install rails | |
RUN gem install rails | |
# Set bundle config | |
RUN bundle config --global path $HOME/.bundle/vendor && \ | |
chgrp -R 0 $HOME/.bundle && chmod -R g=u $HOME/.bundle && \ | |
chgrp -R 0 $HOME/.local && chmod -R g=u $HOME/.local && \ | |
chgrp -R 0 $HOME/.rbenv && chmod -R g=u $HOME/.rbenv | |
USER 10001 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Taken from: https://github.com/l0rd/rails-blog/blob/devfile/.devfile.Dockerfile