Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.
ZeroC0D3 Team edited this page Nov 19, 2017 · 1 revision

Docker

Configuration for Ruby installation in Dockerfile

  • From Image
    FROM zeroc0d3lab/centos-base-workspace-lite:latest
    
  • Environment
    ENV RUBY_VERSION=2.4.2
    ENV RUBY_PACKAGE="rbenv"
    # ("rbenv" = using rbenv package manager, "rvm" = using rvm package manager)
    
  • Create rootfs/root folder
  • Copy all sources in this repo to rootfs/root folder
  • Configure as root
    USERNAME='root'
    PATH_HOME='/root'
    
  • Command Installation Ruby in Dockerfile
    #-----------------------------------------------------------------------------
    # Prepare Install Ruby
    # -) copy .zshrc to /root
    # -) copy .bashrc to /root
    #-----------------------------------------------------------------------------
    RUN git clone https://github.com/zeroc0d3/ruby-installation /opt/ruby_installer 
    
    COPY ./rootfs/root/.zshrc /root/.zshrc
    COPY ./rootfs/root/.bashrc /root/.bashrc
    RUN sudo /bin/sh /opt/ruby_installer/install_ruby.sh
    
    #-----------------------------------------------------------------------------
    # Install Ruby Packages (rbenv/rvm)
    #-----------------------------------------------------------------------------
    RUN sudo /bin/sh /opt/ruby_installer/gems.sh
    
  • Sample project for Docker Ruby, visit zeroc0d3/docker-lab repository
Clone this wiki locally