|
# dockerFile |
|
# 2015/2/25 |
|
# CentOS Server |
|
# playframework2.x (oracle java8, scala) |
|
|
|
# CentOS version 6 |
|
FROM centos:centos6 |
|
MAINTAINER cive <hukurou55.1@gmail.com> |
|
|
|
WORKDIR /data |
|
|
|
RUN yum update -y |
|
# initscripts => ランレベルの変更やネットワークの活性化/非活性化、システムシャットダウンやシステムブートの為の基本的なシステムスクリプト |
|
# MAKEDEV => deviceファイルの作成 |
|
RUN yum -y install initscripts MAKEDEV tar unzip |
|
# OpenSSH |
|
RUN yum -y install passwd openssh-server sudo |
|
RUN sed -ri 's/^#PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config |
|
RUN sed -ri 's/^UsePAM yes/UsePAM no/' /etc/ssh/sshd_config |
|
RUN /etc/init.d/sshd start |
|
RUN echo 'root:rootpassword' | chpasswd |
|
RUN useradd docker |
|
RUN echo 'docker:dockerpass' | chpasswd |
|
RUN echo "docker ALL=(ALL) ALL" >> /etc/sudoers.d/docker |
|
|
|
# Java |
|
RUN yum -y install wget |
|
RUN wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u31-b13/jdk-8u31-linux-x64.rpm |
|
RUN rpm -Uvh jdk-8u31-linux-x64.rpm |
|
RUN rm jdk-8u31-linux-x64.rpm |
|
ENV JAVA_HOME /usr/java/jdk1.8.0_31 |
|
|
|
# Scala |
|
ENV SCALA_VERSION 2.11.5 |
|
RUN wget http://downloads.typesafe.com/scala/${SCALA_VERSION}/scala-${SCALA_VERSION}.tgz |
|
RUN tar xzvf scala-${SCALA_VERSION}.tgz |
|
RUN rm scala-${SCALA_VERSION}.tgz |
|
RUN mv scala-${SCALA_VERSION} /usr/local/ |
|
RUN ln -s /usr/local/scala-${SCALA_VERSION} /usr/local/scala |
|
ENV SCALA_HOME /usr/local/scala |
|
ENV PATH ${PATH}:${SCALA_HOME}/bin |
|
|
|
# sbt |
|
ENV SBT_VERSION 0.13.7 |
|
RUN wget https://dl.bintray.com/sbt/native-packages/sbt/${SBT_VERSION}/sbt-${SBT_VERSION}.tgz |
|
RUN tar xzvf sbt-${SBT_VERSION}.tgz |
|
RUN rm sbt-${SBT_VERSION}.tgz |
|
RUN mv sbt /usr/local/ |
|
ENV SBT_HOME /usr/local/sbt |
|
ENV PATH ${PATH}:${SBT_HOME}/bin |
|
|
|
# activator(playframework) |
|
# playframework 2.3.8 |
|
ENV ACTIVATOR_VERSION 1.3.2 |
|
RUN wget http://downloads.typesafe.com/typesafe-activator/${ACTIVATOR_VERSION}/typesafe-activator-${ACTIVATOR_VERSION}-minimal.zip |
|
RUN unzip typesafe-activator-${ACTIVATOR_VERSION}-minimal.zip |
|
RUN rm typesafe-activator-${ACTIVATOR_VERSION}-minimal.zip |
|
RUN mv activator-${ACTIVATOR_VERSION}-minimal /usr/local/activator |
|
RUN ln -s /usr/local/activator-${ACTIVATOR_VERSION}-minimal /usr/local/activator |
|
ENV ACTIVATOR_HOME /usr/local/activator |
|
ENV PATH ${PATH}:${ACTIVATOR_HOME} |
|
|
|
# PATH |
|
RUN echo -e '\n# scala\nexport SCALA_HOME="/usr/local/scala"' >> /root/.bashrc |
|
RUN echo -e '\n# scala\nexport PATH="/usr/local/scala/bin:$PATH"' >> /root/.bashrc |
|
RUN echo -e '\n# sbt\nexport PATH="/usr/local/sbt/bin:$PATH"' >> /root/.bashrc |
|
RUN echo -e '\n# play\nexport PATH="/usr/local/activator:$PATH"' >> /root/.bashrc |
|
CMD ["bash"] |
|
|
|
EXPOSE 22 |
|
CMD ["/usr/sbin/sshd", "-D"] |