FROM centos:7

LABEL maintainer="OnApp"

RUN curl -sL https://rpm.nodesource.com/setup_10.x | bash -

RUN yum -y update && \
    yum -y groupinstall 'Development Tools' && \
    yum -y install \
        make \
        wget \
        openssh-clients \
        git \
        mysql-devel \
        libvirt-devel \
        nodejs

# installing specific version of ruby centos7 repo might contain unsuitable ruby version
# RUN wget -O ruby-install-0.8.5.tar.gz https://github.com/postmodern/ruby-install/archive/v0.8.5.tar.gz && \
#     mkdir ruby-install && \
#     tar -xzvf ruby-install-0.8.5 -C ruby-install --strip 1 && \
#     rm -f ruby-install-0.8.5 && \
#     cd ruby-install && \
#     make install && \
#     ruby-install --system ruby 3.0.5 && \
#     cd .. && \
#     rm -fr ruby-install && \
#     gem install bundler:2.1.4

RUN yum -y install http://rpm.repo.onapp.com/repo/onapp-repo-7.1.noarch.rpm \
    sed -i 's/cdn\.//g' /etc/yum.repos.d/OnApp.repo \
    yum -y install ruby ruby-libs rubygems rubygem-json rubygem-io-console rubygem-bigdecimal ruby-doc ruby-devel \
    gem install bundler:2.1.4

ENV BUNDLE_PATH /gems

WORKDIR /usr/src/app
