FROM centos

# 安装工具
RUN yum -y update
RUN yum install -y make gcc*
RUN yum install -y git
RUN yum install -y vim
RUN yum install -y wget
RUN yum install -y sysvinit-tools
RUN yum install -y telnet

# 安装node
RUN curl -sL https://rpm.nodesource.com/setup_8.x | bash -
RUN yum install -y nodejs

# 切换npm淘宝源
RUN npm config set registry https://registry.npm.taobao.org 

# 安装日志组件
RUN npm i frontail -g --registry=https://registry.npm.taobao.org

# 安装gulp
RUN npm install gulp

# 安装控制台组件
WORKDIR /home
RUN git clone http://git.q-gp.com/QA/qg-xterm.git

WORKDIR /home/qg-xterm
RUN npm install

# 安装forever
RUN npm install -g forever

WORKDIR /home
# 解决中文问题
ENV LANG en_US.UTF-8  
ENV LANGUAGE en_US:en  
ENV LC_ALL en_US.UTF-8 

# 解决时区问题
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# 宋体
RUN curl http://git.q-gp.com/QA/qg-docker-entrypoints/raw/master/fonts/install.sh | sh

# ruby环境
RUN yum groupinstall -y development
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
RUN curl -L get.rvm.io | bash -s stable
RUN source /etc/profile.d/rvm.sh
RUN source $HOME/.rvm/scripts/rvm
RUN rvm reload
RUN rvm install 2.3.3
RUN gem install bundler
RUN git clone git@git.quantgroup.cn:QA/qg-recorder.git;cd qg-recorder
RUN bundle install

# alias
RUN echo "export PS1='\[\033[m\][\[\033[36m\]\u\[\033[m\]:\[\033[33;1m\]\w\[\033[m\]\[\033[m\]]\[\033[m\]# '" >> ~/.bash_profile
RUN echo "export LANG='en_US.UTF-8';alias 'la=ls -al';alias rm='rm -i';alias mv='mv -i';alias grep='grep --color';alias vi='vim';alias pg='ps -ef | grep -i'" >> ~/.bashrc