概要
CentOS 7 上でnode.jsのwebアプリの実行を動作させる環境の構築。
また、jenkinsからバッチを叩きたかったため、jenkinsをインストールしている。
Dockerfile
Dockerfile
FROM centos:7
# install from yum
RUN yum install -y wget tar make gcc gcc-c++ bzip2-devel
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# install python
RUN wget http://www.python.org/ftp/python/2.6.9/Python-2.6.9.tgz
RUN tar xvzf Python-2.6.9.tgz
RUN cd Python-2.6.9 && ./configure && make && make install
# install node.js
RUN wget http://nodejs.org/dist/v0.10.35/node-v0.10.35.tar.gz
RUN tar zxvf node-v0.10.35.tar.gz
ENV PYTHON /usr/local/bin/python2.6
RUN cd node-v0.10.35 && $PYTHON ./configure --dest-cpu=x64 --dest-os=linux && make && make install
EXPOSE 80
# install jenkins
RUN wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
RUN rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
RUN yum install -y jenkins
EXPOSE 8080
CMD systemctl start jenkins && /bin/bash